From 840a81e1667686b6b5b4f1cbcea19b3ebe0ab74f Mon Sep 17 00:00:00 2001 From: tenzap Date: Fri, 20 Dec 2024 22:04:24 +0100 Subject: [PATCH] add patch to fix php8.4 deprecation warnings in XMLRPC --- composer.json | 1 + .../v3.1.13/11-php84_xmlrpc.patch | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch diff --git a/composer.json b/composer.json index 95b2ad97..2875a20b 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "Add support for PHP 8.2 (part3)": "patches/Codeigniter_Framework/v3.1.13/10-php82_support-part3-fix_string_interpolation.patch", "Add support for PHP 8.4 (E_STRICT)": "patches/Codeigniter_Framework/v3.1.13/11-php84_support_E_STRICT.patch", "Add support for PHP 8.4 (implicit nullable type)": "patches/Codeigniter_Framework/v3.1.13/11-php84_support_fix_implicit_nullable_type_error.patch", + "Add support for PHP 8.4 (xmlrpc)": "patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch", "Add support for PHP 8.4 (session sid)": "patches/Codeigniter_Framework/v3.1.13/11-php84_support_session.sid_length_INI_setting_is_deprecated.patch" }, "kenjis/ci-phpunit-test": { diff --git a/patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch b/patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch new file mode 100644 index 00000000..ab02e1e2 --- /dev/null +++ b/patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch @@ -0,0 +1,46 @@ +From cb5487171e7a883f4a0c6346ef0efb8ee7acb2bf Mon Sep 17 00:00:00 2001 +From: Niel Buys +Date: Fri, 20 Dec 2024 15:32:22 +0200 +Subject: [PATCH] Fix PHP 8.4 deprecated warnings Github issue 6306 +Origin: https://github.com/NielBuys/CodeIgniter/pull/2/commits/cb5487171e7a883f4a0c6346ef0efb8ee7acb2bf +Origin: https://github.com/NielBuys/CodeIgniter/pull/2/commits/6a139066bcebf03026ac0b9f0f3f2b548c73aa22 + +--- a/system/libraries/Xmlrpc.php ++++ b/system/libraries/Xmlrpc.php +@@ -1162,10 +1162,9 @@ + 'isf_reason' => 0 + ); + +- xml_set_object($parser, $this); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); +- xml_set_element_handler($parser, 'open_tag', 'closing_tag'); +- xml_set_character_data_handler($parser, 'character_data'); ++ xml_set_element_handler($parser, [$this, 'open_tag'], [$this, 'closing_tag']); ++ xml_set_character_data_handler($parser, [$this, 'character_data']); + //xml_set_default_handler($parser, 'default_handler'); + + // Get headers +--- a/system/libraries/Xmlrpcs.php ++++ b/system/libraries/Xmlrpcs.php +@@ -233,7 +233,7 @@ + //------------------------------------- + + $parser = xml_parser_create($this->xmlrpc_defencoding); +- $parser_object = new XML_RPC_Message('filler'); ++ $parser_object = new XML_RPC_Message('default_method', FALSE); + + $parser_object->xh = array( + 'isf' => 0, +@@ -244,10 +244,9 @@ + 'method' => '' + ); + +- xml_set_object($parser, $parser_object); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); +- xml_set_element_handler($parser, 'open_tag', 'closing_tag'); +- xml_set_character_data_handler($parser, 'character_data'); ++ xml_set_element_handler($parser, [$parser_object, 'open_tag'], [$parser_object, 'closing_tag']); ++ xml_set_character_data_handler($parser, [$parser_object, 'character_data']); + //xml_set_default_handler($parser, 'default_handler'); + + //-------------------------------------