now parses correctly some args (empty array and empty string)
authorCiro Scognamiglio <c.scognamiglio@cslash.net>
Mon, 29 May 2017 10:25:04 +0000 (12:25 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 29 May 2017 13:16:01 +0000 (15:16 +0200)
php/plc_api.php

index 0c2187e..9468c04 100644 (file)
@@ -147,7 +147,7 @@ class PLCAPI
                   $members[$vk] = $this->xmlrpcValue($vv);
               }
 
-              if (array_key_exists(0, $value)) {
+              if ((array_key_exists(0, $value)) || (empty($value))) {
                   return new PhpXmlRpc\Value(
                       $members,
                       'array'
@@ -174,12 +174,7 @@ class PLCAPI
               return new PhpXmlRpc\Value($value, 'int');
               break;
           default:
-            if (empty($value)) {
-                return new PhpXmlRpc\Value(null, 'null');
-            } else {
-                return new PhpXmlRpc\Value($value);
-            }
-
+              return new PhpXmlRpc\Value($value);
               break;
       }
   }
@@ -198,7 +193,11 @@ class PLCAPI
    */
   function internal_call_phpxmlrpc($method, $args = NULL, $backtrace_level = 2)
   {
-
+//
+//      echo '<pre>';
+//      var_dump($method);
+//      var_dump($args);
+//      echo '</pre>';
 
       PhpXmlRpc\PhpXmlRpc::$xmlrpc_null_extension = true;