Hello everyone,
I'm on MacOS 10.8, using PHP 5.3.14, Apache 2.2.22.
If I configure multiple addresses on the configuration page (admin/config/people/account_sync/sender) separated as required by a new line, XMLRPC fails with a 303 error: See others. I debug the code and the issue is in the function account_sync_servers(), l114 of the .module:
$all_servers = explode("\n", variable_get('account_sync_servers', ''));
This results with the 13th character at the end of the string (Carriage return). So after that, when XMLRPC make the URI, it transforms this character with an underscore, so the XMLRPC url become: http://www.myserver.com_/xmlrpc.php, instead of http://www.myserver.com/xmlrpc.php.
I fix this by adding a trim, line 120 of the .module (I don't do a patch because I don't know if it's the best way to do it):
function account_sync_servers($account) {
$servers = array();
$all_servers = explode("\n", variable_get('account_sync_servers', ''));
// Strip out blank lines.
$all_servers = array_filter($all_servers);
foreach ($all_servers as $server) {
$results = module_invoke_all('account_sync_servers', $server, $account);
if (!in_array(FALSE, $results)) {
$servers[] = trim($server);
}
}
return $servers;
}
It's a detail in the code, but with fatal consequences!
Comments
Comment #1
Antoine Vigneau commentedComment #2
Antoine Vigneau commented