XMLRPC errors

Found a bug? Tell us!!
Post Reply
zmodem
Posts: 2
Joined: Mon Jan 28, 2008 12:02 am

XMLRPC errors

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: XMLRPC errors

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
zmodem
Posts: 2
Joined: Mon Jan 28, 2008 12:02 am

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply