oops
authorgggeek <giunta.gaetano@gmail.com>
Tue, 31 Jan 2023 20:49:19 +0000 (20:49 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 31 Jan 2023 20:49:19 +0000 (20:49 +0000)
src/Encoder.php
src/Helper/XMLParser.php
src/Request.php
src/Server.php

index 6709e6c..02d9f3e 100644 (file)
@@ -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???
index efba338..bdae23e 100644 (file)
@@ -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)
     {
index 8f1660f..b291065 100644 (file)
@@ -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) {
index 73f828e..cbbb1e1 100644 (file)
@@ -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());
         }