From f4b1932e3502d05ab50041aba4f4c9c800148124 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 26 Feb 2023 21:40:16 +0000 Subject: [PATCH] fix recent change improving checking for unexpected errors in the parser --- src/Request.php | 5 +++-- tests/13LegacyAPITest.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Request.php b/src/Request.php index 203113e1..8da377b0 100644 --- a/src/Request.php +++ b/src/Request.php @@ -356,8 +356,9 @@ class Request //} } // third error check: parsing of the response has somehow gone boink. - /// @todo shall we omit this check, since we trust the parsing code? - elseif ($_xh['isf'] > 3 || ($returnType == XMLParser::RETURN_XMLRPCVALS && !is_object($_xh['value']))) { + /// @todo shall we omit the 2nd part of this check, since we trust the parsing code? + /// Either that, or check the fault results too... + elseif ($_xh['isf'] > 3 || ($returnType == XMLParser::RETURN_XMLRPCVALS && !$_xh['isf'] && !is_object($_xh['value']))) { // something odd has happened and it's time to generate a client side error indicating something odd went on $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_parsing_error'], PhpXmlRpc::$xmlrpcstr['xml_parsing_error'], '', $httpResponse diff --git a/tests/13LegacyAPITest.php b/tests/13LegacyAPITest.php index 4c5c6367..a2991a77 100644 --- a/tests/13LegacyAPITest.php +++ b/tests/13LegacyAPITest.php @@ -9,7 +9,7 @@ class LegacyAPITest extends PhpXmlRpc_ServerAwareTestCase { public function testLegacyLoader() { - /// @todo pass on as cli args for the executed script all the args that are already parsed by now + /// @todo pass on as cli args for the executed script all the args that are already parsed by now, plus $this->testId exec('php ' . __DIR__ . '/legacy_loader_test.php', $out, $result); -- 2.47.0