Recent Topics

1 Jan 18, 2011 14:49    

EDIT: Almost forgot: I'm running 4.0.3.

Since upgrade to the 4.0.x series I have been getting this error in mail from the cron job that polls the antispam service:

Converting from to : not supported

This may be an configuration error on my part, but after days and days looking for it I'm filing it here as bug with a solution, temporary at best, since it seems to me a lowly hack :)

So, the issue is that antispam_poll_abuse() in inc/antispam/model/_antispam.funcs.php calls xmlrpc_client::send() method without setting beforehand xmlrpc_client::request_charset_encoding.

To make the story short, here is the fix:

!bzr diff -r 103..105 inc/antispam/model/_antispam.funcs.php
=== modified file 'inc/antispam/model/_antispam.funcs.php'
--- inc/antispam/model/_antispam.funcs.php      2010-10-01 07:50:06 +0000
+++ inc/antispam/model/_antispam.funcs.php      2011-01-13 19:17:36 +0000
@@ -212,6 +212,10 @@
        load_funcs('xmlrpc/model/_xmlrpc.funcs.php');
        $client = new xmlrpc_client( $antispamsrv_uri, $antispamsrv_host, $antispamsrv_port);
        $client->debug = $debug;
+       /* Fixes warning on cron "conversion from to: not supported"
+        * Larry Nieves <lnieves@315-web.com>
+        */
+       $client->request_charset_encoding = $GLOBALS['xmlrpc_internalencoding'] = 'utf-8' ;

        // Get datetime from last update, because we only want newer stuff...
        $last_update = $Settings->get( 'antispam_last_update' );
@@ -459,4 +463,4 @@
 /*
  * $Log: _antispam.funcs.php,v $
  */
-?>
\ No newline at end of file
+?>

I set $client->request_charset_encoding = $GLOBALS['xmlrpc_internalencoding'] = 'utf-8' because I know i'm using utf-8 everywhere, but for other systems this would surely cause more trouble than it solves. That's why i consider it a lowly hack.

There must be somewhere someway to set those variables to sensible values depending on the system/blog configuration, but i simply don't have enough time to find it.

BTW $GLOBALS['xmlrpc_internalencoding'] is used by xmlrpc_encode_entities() in inc/_ext/xmlrpc/_xmlrpc.inc.php, which is the function that actually emits the error.

2 Aug 01, 2011 06:25

I just found the same error message in server logs. Seem like we should supply internal PHP encoding value, I edited the fix a bit and added to CVS

if( function_exists('mb_internal_encoding') )
{	// Fixes warning on cron "Converting from  to : not supported..."
	$client->request_charset_encoding = $GLOBALS['xmlrpc_internalencoding'] = mb_internal_encoding();
}

3 Feb 19, 2012 10:00

Ah yeah, forgot about that command. Thanks for the reminder Doomer


Form is loading...