Skip to content

Commit

Permalink
dev-php/PEAR-Mail_mimeDecode: add patch for PHP8 compatibility.
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/833075
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
  • Loading branch information
jkroonza committed Feb 10, 2022
1 parent a8a8866 commit 1337ec6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
EAPI=8

inherit php-pear-r2

Expand All @@ -15,6 +15,10 @@ RESTRICT="!test? ( test )"
RDEPEND=">=dev-php/PEAR-Mail_Mime-1.5.2"
DEPEND="test? ( ${RDEPEND} dev-php/PEAR-PEAR )"

PATCHES=(
"${FILESDIR}/PEAR-Mail_mimeDecode-1.5.6-r3-php8_compat.diff"
)

src_test() {
pear run-tests tests || die
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -bru a/Mail/mimeDecode.php b/Mail/mimeDecode.php
--- a/Mail/mimeDecode.php 2016-08-29 05:04:25.000000000 +0200
+++ b/Mail/mimeDecode.php 2022-02-10 12:25:54.140741592 +0200
@@ -834,7 +834,7 @@

// Replace encoded characters

- $cb = create_function('$matches', ' return chr(hexdec($matches[0]));');
+ $cb = function($matches) { return chr(hexdec($matches[0])); };

$input = preg_replace_callback( '/=([a-f0-9]{2})/i', $cb, $input);

0 comments on commit 1337ec6

Please sign in to comment.