mirror of
https://github.com/cytopia/devilbox.git
synced 2025-03-22 20:15:29 +00:00
Fix PHP 7.2 deprecated function: create_function()
This commit is contained in:
parent
d17e9bf6fe
commit
9a9cb55917
14
.devilbox/www/include/vendor/Mail/mimeDecode.php
vendored
14
.devilbox/www/include/vendor/Mail/mimeDecode.php
vendored
@ -832,10 +832,16 @@ class Mail_mimeDecode extends PEAR
|
||||
// Remove soft line breaks
|
||||
$input = preg_replace("/=\r?\n/", '', $input);
|
||||
|
||||
// Replace encoded characters
|
||||
|
||||
$cb = create_function('$matches', ' return chr(hexdec($matches[0]));');
|
||||
|
||||
// cytopia edit
|
||||
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
|
||||
$cb = function($matches) {
|
||||
return chr(hexdec($matches[0]));
|
||||
};
|
||||
} else {
|
||||
// Replace encoded characters
|
||||
$cb = create_function('$matches', ' return chr(hexdec($matches[0]));');
|
||||
}
|
||||
|
||||
$input = preg_replace_callback( '/=([a-f0-9]{2})/i', $cb, $input);
|
||||
|
||||
return $input;
|
||||
|
Loading…
x
Reference in New Issue
Block a user