From: gggeek <giunta.gaetano@gmail.com>
Date: Tue, 31 Jan 2023 20:49:19 +0000 (+0000)
Subject: oops
X-Git-Tag: 4.10.0~48
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a29da6f009ee84c95259cee4013144801aba0b60;p=plcapi.git

oops
---

diff --git a/src/Encoder.php b/src/Encoder.php
index 6709e6ca..02d9f3e7 100644
--- a/src/Encoder.php
+++ b/src/Encoder.php
@@ -331,7 +331,7 @@ class Encoder
             XMLParser::ACCEPT_REQUEST | XMLParser::ACCEPT_RESPONSE | XMLParser::ACCEPT_VALUE | XMLParser::ACCEPT_FAULT,
             $parserOptions
         );
-        $_xh = $xmlRpcParser->_xh['isf'];
+        $_xh = $xmlRpcParser->_xh;
 
         if ($_xh['isf'] > 1) {
             // test that $_xh['value'] is an obj, too???
diff --git a/src/Helper/XMLParser.php b/src/Helper/XMLParser.php
index efba3383..bdae23e2 100644
--- a/src/Helper/XMLParser.php
+++ b/src/Helper/XMLParser.php
@@ -146,6 +146,8 @@ class XMLParser
      * @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
      *
      * @todo refactor? we could 1. return the parsed data structure, and 2. move $returnType and $accept into options
+     * @todo feature-creep make it possible to pass in options overriding usage of PhpXmlRpc::$xmlrpc_XXX_format, so
+     *       that parsing will be completely independent of global state. Note that it might incur a small perf hit...
      */
     public function parse($data, $returnType = self::RETURN_XMLRPCVALS, $accept = 3, $options = array())
     {
@@ -868,6 +870,8 @@ class XMLParser
      *                PhpXmlRpc::$xmlrpc_defencoding if it can't be determined and mbstring is not enabled
      *
      * @todo explore usage of mb_http_input(): does it detect http headers + post data? if so, use it instead of hand-detection!!!
+     * @todo feature-creep make it possible to pass in options overriding usage of PhpXmlRpc static variables, to make
+     *       the method independent of global state
      */
     public static function guessEncoding($httpHeader = '', $xmlChunk = '', $encodingPrefs = null)
     {
diff --git a/src/Request.php b/src/Request.php
index 8f1660f9..b2910655 100644
--- a/src/Request.php
+++ b/src/Request.php
@@ -309,7 +309,7 @@ class Request
 
         $xmlRpcParser = $this->getParser();
         $xmlRpcParser->parse($data, $returnType, XMLParser::ACCEPT_RESPONSE, $options);
-        $_xh = $xmlRpcParser->_xh['isf'];
+        $_xh = $xmlRpcParser->_xh;
 
         // first error check: xml not well-formed
         if ($_xh['isf'] == 3) {
diff --git a/src/Server.php b/src/Server.php
index 73f828e0..cbbb1e13 100644
--- a/src/Server.php
+++ b/src/Server.php
@@ -691,7 +691,7 @@ class Server
         $xmlRpcParser = $this->getParser();
         try {
             $xmlRpcParser->parse($data, $this->functions_parameters_type, XMLParser::ACCEPT_REQUEST, $options);
-            $_xh = $xmlRpcParser->_xh['isf'];
+            $_xh = $xmlRpcParser->_xh;
         } catch (NoSuchMethodException $e) {
             return new Response(0, $e->getCode(), $e->getMessage());
         }