mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-24 20:01:36 +02:00
fix PHP Deprecated: preg_replace(): The /e modifier is deprecated
This commit is contained in:
parent
8e5adb50f7
commit
854d17b46b
@ -1875,16 +1875,23 @@ class PHPMailer {
|
|||||||
|
|
||||||
switch (strtolower($position)) {
|
switch (strtolower($position)) {
|
||||||
case 'phrase':
|
case 'phrase':
|
||||||
$encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
|
$encoded = preg_replace_callback("/([^A-Za-z0-9!*+\/ -])/", function($matches)
|
||||||
|
{
|
||||||
|
return '='.sprintf('%02X', ord($matches[1]));
|
||||||
|
}, $encoded);
|
||||||
break;
|
break;
|
||||||
case 'comment':
|
case 'comment':
|
||||||
$encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
|
$encoded = preg_replace_callback("/([\(\)\"])/", function($matches)
|
||||||
|
{
|
||||||
|
return '='.sprintf('%02X', ord($matches[1]));
|
||||||
|
}, $encoded);
|
||||||
case 'text':
|
case 'text':
|
||||||
default:
|
default:
|
||||||
// Replace every high ascii, control =, ? and _ characters
|
// Replace every high ascii, control =, ? and _ characters
|
||||||
//TODO using /e (equivalent to eval()) is probably not a good idea
|
$encoded = preg_replace_callback('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/', function($matches)
|
||||||
$encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
|
{
|
||||||
"'='.sprintf('%02X', ord('\\1'))", $encoded);
|
return '='.sprintf('%02X', ord($matches[1]));
|
||||||
|
}, $encoded);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user