[phpxmlrpc-devel] Empty lines patch
Brought to you by:
ggiunta
From: Dougal C. <do...@gu...> - 2003-05-16 17:46:02
|
While playing with Scott Andrew LePera's pubsub experiments[1], we ran across a problem in the XML-RPC library. At first, we thought it was caused by Scott including a <!-- comment --> in his XML response, but I finally tracked down the real source of the problem, which was extra whitespace between the response's headers and content. I've attached a diff file to work around this problem. I made two minor changes. First, it uses preg_split() instead of just split(), in order to catch the possibility of lines ending in just '\n' instead of '\r\n'. This is in order to follow the tenet of "be generous in what you receive, strict in what you send". Next, it checks for any empty elements at the beginning of the $ar before joining them into the $data array, because otherwise, the call to xml_parse will choke. [1] http://www.scottandrew.com/main/2003_05#a000658 -- Ernest MacDougal Campbell III, MCP+I, MCSE <do...@gu...> http://dougal.gunters.org/ http://spam.gunters.org/ Web Design & Development: http://www.mentalcollective.com/ This message is guaranteed to be 100% eror frea! |