Skip to content

Commit

Permalink
add patch to fix php8.4 deprecation warnings in XMLRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzap committed Dec 21, 2024
1 parent e9e4ef9 commit 730f17f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
46 changes: 46 additions & 0 deletions patches/Codeigniter_Framework/v3.1.13/11-php84_xmlrpc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From cb5487171e7a883f4a0c6346ef0efb8ee7acb2bf Mon Sep 17 00:00:00 2001
From: Niel Buys <[email protected]>
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');

//-------------------------------------

0 comments on commit 730f17f

Please sign in to comment.