mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-20 05:17:53 +00:00
Merge pull request #339 from cytopia/php-72-depreceated
Fix PHP 7.2 deprecated function: create_function()
This commit is contained in:
commit
fad7571875
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…
Reference in New Issue
Block a user