The line
$xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $xmlrpc_message->message);
in xmlrpc_message_parse() is not save for big XML-PRC responses (>100.000 chars). preg_replace() has an implicit limit (see http://de3.php.net/preg_replace#84285) and returns NULL for the big XML-RPC responses.
I propose to use a less elegant, but working(!) version:
$pos1 = strpos($xmlrpc_message->message, '<?xml');
if ($pos1 !== FALSE) {
$pos2 = strpos($xmlrpc_message->message, '?>', $pos1);
if ($pos1 !== FALSE) {
$xmlrpc_message->message = substr($xmlrpc_message->message, $pos2+2);
}
}
Since the issue makes xmlrpc() not working for all kind of responses, I mark this issue as critical.
Comments
Comment #1
mikey_p commentedComment #2
bjcool commentedWhat is the status of this bug? Currently the xmlrpc client is not useable for some/many responses. Does some care?
Comment #3
bjcool commentedSwitching to 7.x-dev since this issue is also present in 7.x-dev.
Comment #4
robbertnl commentedSubscribing. Also getting 'Parse error. Request not well formed' when saving big(>98k) body fields via XMLRPC (Using Drupal 6.14 and Services module).
Workaround by bjcool works for me. So i hope this bug will be fixed for 6.x as well.
Comment #5
bjcool commentedAs workaround you can configure greater limits for pcre:
Comment #6
damien tournoud commentedThis is a duplicate of #265973: XML-RPC chokes with long server response.