From f850eaf728ab6a8ec9bd23cb065416b63983aba5 Mon Sep 17 00:00:00 2001 From: manusfreedom Date: Wed, 4 Jan 2023 19:21:12 +0100 Subject: [PATCH] Fix PHP 8.x compatibility `xml_parser_create` no longer returns a resource but a opaque class `XMLParser`. --- system/libraries/Xmlrpc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 8587015e877..5ff80e58841 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1151,7 +1151,7 @@ public function parseResponse($fp) //------------------------------------- $parser = xml_parser_create($this->xmlrpc_defencoding); - $pname = (string) $parser; + $pname = spl_object_id($parser); $this->xh[$pname] = array( 'isf' => 0, 'ac' => '', @@ -1279,7 +1279,7 @@ public function parseResponse($fp) */ public function open_tag($the_parser, $name) { - $the_parser = (string) $the_parser; + $the_parser = spl_object_id($the_parser); // If invalid nesting, then return if ($this->xh[$the_parser]['isf'] > 1) return; @@ -1380,7 +1380,7 @@ public function open_tag($the_parser, $name) */ public function closing_tag($the_parser, $name) { - $the_parser = (string) $the_parser; + $the_parser = spl_object_id($the_parser); if ($this->xh[$the_parser]['isf'] > 1) return; @@ -1514,7 +1514,7 @@ public function closing_tag($the_parser, $name) */ public function character_data($the_parser, $data) { - $the_parser = (string) $the_parser; + $the_parser = spl_object_id($the_parser); if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already