X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FRequest.php;h=b3b8112afc0ef1d16248a8ddc7c12ed5329dc938;hb=7fbd194478e080d624bab075d189bf3ba215325d;hp=0051e4633d8372eeaf0cb6d92b96d1224caaaab8;hpb=9d4cfc9508b03a579dd62a28c0e9e428b5052f9b;p=plcapi.git diff --git a/src/Request.php b/src/Request.php index 0051e46..b3b8112 100644 --- a/src/Request.php +++ b/src/Request.php @@ -109,7 +109,7 @@ class Request */ public function addParam($param) { - // add check: do not add to self params which are not xmlrpc values + // check: do not add to self params which are not xmlrpc values if (is_object($param) && is_a($param, 'PhpXmlRpc\Value')) { $this->params[] = $param; @@ -288,7 +288,7 @@ class Request xml_set_default_handler($parser, 'xmlrpc_dh'); // first error check: xml not well formed - if (!xml_parse($parser, $data, count($data))) { + if (!xml_parse($parser, $data, 1)) { // thanks to Peter Kocks if ((xml_get_current_line_number($parser)) == 1) { $errStr = 'XML error at line 1, check URL'; @@ -298,7 +298,7 @@ class Request xml_get_current_line_number($parser), xml_get_current_column_number($parser)); } error_log($errStr); - $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'], PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' (' . $errStr . ')'); + $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'], PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' ' . $errStr); xml_parser_free($parser); if ($this->debug) { print $errStr; @@ -334,8 +334,7 @@ class Request ); } - // note that using =& will raise an error if $xmlRpcParser->_xh['st'] does not generate an object. - $v = &$xmlRpcParser->_xh['value']; + $v = $xmlRpcParser->_xh['value']; if ($xmlRpcParser->_xh['isf']) { /// @todo we should test here if server sent an int and a string, and/or coerce them into such... @@ -380,10 +379,10 @@ class Request /** * Enables/disables the echoing to screen of the xmlrpc responses received. * - * @param integer $in values 0, 1, 2 are supported + * @param integer $level values 0, 1, 2 are supported */ - public function setDebug($in) + public function setDebug($level) { - $this->debug = $in; + $this->debug = $level; } }