XML_RPC_Client can be more tollerant?
| From: | luca\.mariano\@email\.it | Date: | Tue, 16 Dec 2003 08:42:43 +0000 |
| Subject: | XML_RPC_Client can be more tollerant? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-24458@lists.php.net to get a copy of this message | ||
Hi,
I'm facing a problem using XML_RPC_Client.
After a HTTPT 200 response is received from server, the responde header is trashed, then the
repsonse body ($data) is entirely passed to the xml parser:
xml_parse($parser, $data, sizeof($data))
xml_parse return FALSE if the reponse contains junk after the </methodResponse> tag; this can
happen for a couple of reasons, in my case it happens because I'm using a free server that is
configured to append a javascript string at each served page (I think they're using a custom
Apache filter).
I've seen XML-RPC specs, in no point it's underlined that the response cannot contains
junk after a valid methodResponse.
We can patch this easily, without BC problems, by prepending the xml_parse with something like this:
$data = substr($data,0,strpos($data,"</methodResponse>")+17);
The substr can never fail, because the closing tag for methodResponse is mandatory.
Such way the XML_RPC_Client will become much more tolerant...
Bye,
Luca
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Difendi la tua casella di posta dai virus e dallo spam, prendi Email.it Pro15, Pro50 o Pro100 la
casella professionale e sicura.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1048&d=16-12