X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpcs.inc;h=0ab6d5485bcf9a10a7efa687aec6a4beb5288bc7;hb=f49e4f7f149082ee5f029e4693cb94bf3a244198;hp=6dd64a51fef3bcb4f2d9562c6ba7f619bfc98543;hpb=490862c33009397151ac39c811b6ee8e24689692;p=plcapi.git diff --git a/lib/xmlrpcs.inc b/lib/xmlrpcs.inc index 6dd64a5..0ab6d54 100644 --- a/lib/xmlrpcs.inc +++ b/lib/xmlrpcs.inc @@ -493,11 +493,19 @@ */ var $user_data = null; + /** + * @deprecated + */ + function xmlrpc_client($dispMap=null, $serviceNow=true) + { + self::__construct($dispMap, $serviceNow); + } + /** * @param array $dispmap the dispatch map with definition of exposed services * @param boolean $servicenow set to false to prevent the server from running upon construction */ - function xmlrpc_server($dispMap=null, $serviceNow=true) + function __construct($dispMap=null, $serviceNow=true) { // if ZLIB is enabled, let the server by default accept compressed requests, // and compress responses sent to clients that support them @@ -587,7 +595,7 @@ if ($data === null) { // workaround for a known bug in php ver. 5.2.2 that broke $HTTP_RAW_POST_DATA - $data = file_get_contents('php://input'); + $data = file_get_contents('php://input'); } $raw_data = $data; @@ -931,22 +939,22 @@ if ($req_encoding != '') { - // Since parsing will fail if charset is not specified in the xml prologue, - // the encoding is not UTF8 and there are non-ascii chars in the text, we try to work round that... - // The following code might be better for mb_string enabled installs, but - // makes the lib about 200% slower... - //if (!is_valid_charset($req_encoding, array('UTF-8'))) - if (!in_array($req_encoding, array('UTF-8', 'US-ASCII')) && !has_encoding($data)) { - if ($req_encoding == 'ISO-8859-1') { - $data = utf8_encode($data); - } else { - if (extension_loaded('mbstring')) { - $data = mb_convert_encoding($data, 'UTF-8', $req_encoding); - } else { - error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received request: ' . $req_encoding); - } - } - } + // Since parsing will fail if charset is not specified in the xml prologue, + // the encoding is not UTF8 and there are non-ascii chars in the text, we try to work round that... + // The following code might be better for mb_string enabled installs, but + // makes the lib about 200% slower... + //if (!is_valid_charset($req_encoding, array('UTF-8'))) + if (!in_array($req_encoding, array('UTF-8', 'US-ASCII')) && !has_encoding($data)) { + if ($req_encoding == 'ISO-8859-1') { + $data = utf8_encode($data); + } else { + if (extension_loaded('mbstring')) { + $data = mb_convert_encoding($data, 'UTF-8', $req_encoding); + } else { + error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received request: ' . $req_encoding); + } + } + } } $parser = xml_parser_create();