summaryrefslogtreecommitdiffstats
path: root/debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2025-02-26 09:36:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2025-02-26 09:36:13 +0000
commit06ceac7c2310be40b8f281ab304f941e7759785f (patch)
tree594bed430b3fd436accacec6605b7bf91aae0440 /debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch
parentAdding upstream version 1.8.4. (diff)
downloadphp-kissifrot-php-ixr-debian.tar.xz
php-kissifrot-php-ixr-debian.zip
Adding debian version 1.8.4-4.debian/1.8.4-4debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch')
-rw-r--r--debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch b/debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch
new file mode 100644
index 0000000..c399430
--- /dev/null
+++ b/debian/patches/02-fix-deprecated-xml_set_-calls-php8.4.patch
@@ -0,0 +1,29 @@
+From 15bc2183654e230658b1bd7f155e0b21d1539d71 Mon Sep 17 00:00:00 2001
+From: Andreas Gohr <andi@splitbrain.org>
+Date: Mon, 25 Nov 2024 14:50:44 +0100
+Subject: [PATCH] fix deprecated xml_set_* calls
+Origin: https://github.com/kissifrot/php-ixr/pull/12
+
+Instead of first setting the handler object and then passing the
+handlers as strings, handlers should be set via proper callables.
+The old method has been deprecated in PHP 8.4
+---
+ src/Message/Message.php | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/Message/Message.php b/src/Message/Message.php
+index d932431..8203e37 100644
+--- a/src/Message/Message.php
++++ b/src/Message/Message.php
+@@ -65,9 +65,8 @@ public function parse()
+ // Set XML parser to take the case of tags in to account
+ xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
+ // Set XML parser callback functions
+- xml_set_object($this->_parser, $this);
+- xml_set_element_handler($this->_parser, 'tagOpen', 'tagClose');
+- xml_set_character_data_handler($this->_parser, 'cdata');
++ xml_set_element_handler($this->_parser, [$this, 'tagOpen'], [$this, 'tagClose']);
++ xml_set_character_data_handler($this->_parser, [$this, 'cdata']);
+ $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
+ $final = false;
+ do {