Error of: preg_replace_callback

-1

Some precise functionality of sending emails and before sending normally, however, now the following message appears:

  

Deprecated: preg_replace (): The / e modifier is deprecated, use preg_replace_callback instead in /srv/disk35/4754145/www/meusite.com/phpmailer/class.phpmailer.php on line 1922

How do I solve this problem?

Below I transcribe the excerpt from the file mentioned in the message:

// Replace every high ascii, control =, ? and _ characters
//TODO using /e (equivalent to eval()) is probably not a good idea
$encoded = preg_replace('/([
// Replace every high ascii, control =, ? and _ characters
//TODO using /e (equivalent to eval()) is probably not a good idea
$encoded = preg_replace('/([%pre%0-1346-75777-7])/e',
                        "'='.sprintf('%02X', ord(stripslashes('\1')))", $encoded);
break;
0-1346-75777-7])/e', "'='.sprintf('%02X', ord(stripslashes('\1')))", $encoded); break;
    
asked by anonymous 24.09.2018 / 08:47

1 answer

1

Your code should be using an older version of PHP Mailer. Try to update it and make sure the error persists.

link

If you are using composer:

composer update phpmailer/phpmailer
    
24.09.2018 / 16:43