Better support for 'undefined' values in debugger's 'load method synopsis'
authorgggeek <giunta.gaetano@gmail.com>
Sat, 30 May 2015 09:18:29 +0000 (11:18 +0200)
committergggeek <giunta.gaetano@gmail.com>
Sat, 30 May 2015 09:18:29 +0000 (11:18 +0200)
debugger/action.php

index 18d9295..0e6ee45 100644 (file)
@@ -373,13 +373,20 @@ if ($action) {
                                         echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
                                         if ($wstype != 1) {
                                             $type = $y->scalarval();
-                                            if ($type == 'null') {
-                                                $type = 'nil';
+                                            $payload .= '<param><value>';
+                                            switch($type) {
+                                                case 'undefined':
+                                                    break;
+                                                case 'null';
+                                                    $type = 'nil';
+                                                    // fall thru intentionally
+                                                default:
+                                                    $payload .= '<' .
+                                                        htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+                                                        '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+                                                        '>';
                                             }
-                                            $payload = $payload . '<param><value><' .
-                                                htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
-                                                '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
-                                                "></value></param>\n";
+                                            $payload .= "</value></param>\n";
                                         }
                                         $alt_payload .= $y->scalarval();
                                         if ($k < $x->arraysize() - 1) {