Ticket #7794 (closed defect (bug): fixed)

Opened 3 months ago

Last modified 3 days ago

Got and fixed an error 'faultCode -32700 faultString parse error. not well formed' on XMLRPC request.

Reported by: Minor Assigned to: anonymous
Priority: high Milestone: 2.8
Component: XML-RPC Version: 2.6
Severity: major Keywords: reporter-feedback has-patch
Cc: josephscott, westi

Description

I've worked with XML-RPC requests and founded that some of my requests got this error. As I'm a developer - it's my work to repair the bugs.

I've founded the bug in the 'wp-includes/class-IXR.php' file. There is a problem in the 157 string (Class IXR_Message, function parse, string 2). Here it is.

'$this->message = preg_replace('/<\?xml(.*)?\?'.'>/', , $this->message);'

$this->message value before this string was correct but after preg_replace it's value sometimes became NULL.

There is a topics where this problem is discussed.

http://bugs.php.net/bug.php?id=40961&thanks=6

http://bugs.php.net/bug.php?id=41580

I've founded a solution to fix that. Change that string to

'$this->message = preg_replace('/<\?xml.*?\?'.'>/', , $this->message);'

( only round brackets were deleted).

I've founded and fixed this bug on the WP 2.6 - 2.6.2 on PHP 5.2.6 (Linuks) and 5.2.4 (Windows).

Attachments

wp-includes--class-IXR.php.diff (0.5 kB) - added by josephscott on 01/05/09 21:40:41.

Change History

09/26/08 20:00:28 changed by josephscott

  • cc set to josephscott.

I haven't run into this before. I'd like to get more info on this before changing a regex that seems to have been working pretty well so far. At a minimum I want to be able reproduce the problem.

Can you provide the raw XML (with username/passwords removed) for before and after the regex, along with the final raw XML-RPC response.

09/26/08 20:51:08 changed by westi

  • cc changed from josephscott to josephscott, westi.
  • keywords set to reporter-feedback.

12/29/08 02:36:13 changed by jacobsantos

  • keywords changed from reporter-feedback to reporter-feedback needs-patch.

01/05/09 21:40:29 changed by josephscott

  • keywords changed from reporter-feedback needs-patch to reporter-feedback has-patch.

I was able to come up with a test case where I could reliably fix the problem. Confirmed that removing the capturing parens fixed the problem. So I've included a patch that takes care of that. I'm also going to try and get the accepted upstream.

01/05/09 21:40:41 changed by josephscott

  • attachment wp-includes--class-IXR.php.diff added.

01/06/09 05:28:53 changed by azaozz

  • status changed from new to closed.
  • resolution set to fixed.

(In [10318]) Fix parse error.not well formed on XMLRPC request, props josephscott, fixes #7794