X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpcs.inc;h=24cba8c2b36bf4b6a304b4e22d44a0ac54a97ad7;hb=7738461a542eae4a26c6253906843ce1aabe9add;hp=6dd64a51fef3bcb4f2d9562c6ba7f619bfc98543;hpb=f45909a92b268970729c121269af62d71eb7cd47;p=plcapi.git diff --git a/lib/xmlrpcs.inc b/lib/xmlrpcs.inc index 6dd64a5..24cba8c 100644 --- a/lib/xmlrpcs.inc +++ b/lib/xmlrpcs.inc @@ -497,7 +497,7 @@ * @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 @@ -529,6 +529,14 @@ } } + /** + * @deprecated + */ + function xmlrpc_client($dispMap=null, $serviceNow=true) + { + self::__construct($dispMap, $serviceNow); + } + /** * Set debug level of server. * @param integer $in debug lvl: determines info added to xmlrpc responses (as xml comments) @@ -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();