Page 1 of 1

XMLRPC errors

Posted: Mon Jan 28, 2008 12:13 am
by zmodem
Hi all,

I recently upgraded from 1.1x to 1.21. In so doing, the XMLRPC interface broke. WLW and Blogdesk are the two that I have tried. Currently using XMLRPC 1.32

The message WLW returns is:

Code: Select all

The response to the metaWeblog.editPost method received from the weblog server was invalid:

Invalid response document returned from XmlRpc server
I've tried several different API's, nothing has worked yet.

WLW grabs the categories and recent articles, but returns the above error whenever I attempt to publish it.

I used fiddler2 (an HTTP debugger) and discovered hundreds of the following lines contained in the response from the server during a publish operation:

Code: Select all

<b>Warning</b>:  cannot yet handle MBCS in html_entity_decode()! in <b>/home/hobbycod/public_html/plugins/serendipity_event_xmlrpc/serendipity_xmlrpc.inc.php</b> on line <b>533</b><br />
Also, and while digging around the code, I noticed there are no closing PHP tags (?>) used in most of the XMLRPC code.

How can we get this working again?

Thanks!

PHP 4.4.4
s9y 1.21
XMLRPC 1.32

Re: XMLRPC errors

Posted: Mon Jan 28, 2008 11:39 am
by garvinhicking
Hi!

Closing ?> tags are optional, that's no problem.


This error:

Code: Select all

<b>Warning</b>:  cannot yet handle MBCS in html_entity_decode()! in <b>/home/hobbycod/public_html/plugins/serendipity_event_xmlrpc/serendipity_xmlrpc.inc.php</b> on line <b>533</b><br />
sounds as if there are wrong/improper characters sent to the server.

Did you only upgrade Serendipity's Core or the plugin as well? Because the s9y core itself should not be related to XMLRPC, that's all handled by the XMLRPC plugin...

What's your URL?

Regards,
Garvin

Posted: Mon Jan 28, 2008 9:42 pm
by zmodem
www.hobbycode.com/serendipity_xmlrpc.php

Googled the error message and discovered this:

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

Status is "won't fix" :/

Does that sound like the issue to you?

Posted: Tue Jan 29, 2008 10:15 am
by garvinhicking
Hi!

Have a look at your s9y blog configuration and see which charset it uses. Make sure your custom XMLRPC application uses the same charset, preferrably UTF-8 for both Server and Client? Then no recoding should be necessary...?

Another hotfix would be to edit the serendipity_xmlrpc.inc.php file at line 533 and change:

Code: Select all

$entry['title']          = html_entity_decode($post_array['title'],ENT_COMPAT,'UTF-8');
to:

Code: Select all

$entry['title']          = @html_entity_decode($post_array['title'],ENT_COMPAT,'UTF-8');
or

Code: Select all

$entry['title']          = $post_array['title'];
(The same change needs to be applied to row 439)

Regards,
Garvin

Posted: Sun Apr 13, 2008 10:13 pm
by Michael Harrison
Any chance of getting this fix added to the repository? The default encoding for s96 is UTF8 and but the plugin needs tweaking to get it to work apparently.
I just had to make this fix locally to get the plugin to work with Zoundry and WLW

Posted: Mon Apr 14, 2008 10:28 am
by garvinhicking
Hi!

Adding this patch would break all usual entity conversions that work in normal charsets... I suggest to upgrade to PHP5. PHP4 is now deprecated, so I think that adding dead compatibility code should not be required.

Regards,
Garvin