Fix compatibility with php 7.2
[plcapi.git] / src / Request.php
index 42ed075..54dc6c0 100644 (file)
@@ -8,7 +8,7 @@ use PhpXmlRpc\Helper\Logger;
 use PhpXmlRpc\Helper\XMLParser;
 
 /**
- * This class provides a representation for a request to an XML-RPC server.
+ * This class provides the representation of a request to an XML-RPC server.
  * A client sends a PhpXmlrpc\Request to a server, and receives back an PhpXmlrpc\Response.
  */
 class Request
@@ -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 <peter.kocks@baygate.com>
             if ((xml_get_current_line_number($parser)) == 1) {
                 $errStr = 'XML error at line 1, check URL';