Skip to content
Permalink
Browse files

General: Patch PHMailer for PHP 7.4 compatibility.

This patches the PHPMailer library in Core to be PHP 7.4 compatible by adding a version check before calling `get_magic_quotes_runtime()`.

Props ayeshrajans, jrf.
See #47783.

git-svn-id: https://develop.svn.wordpress.org/trunk@46378 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Oct 3, 2019
1 parent 80b4dbf commit f13714d9d1a2fca9f470edec798792e7d8181551
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/wp-includes/class-phpmailer.php
@@ -2712,7 +2712,7 @@ protected function encodeFile($path, $encoding = 'base64')
if (!self::isPermittedPath($path) or !file_exists($path)) {
throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
}
$magic_quotes = get_magic_quotes_runtime();
$magic_quotes = ( PHP_VERSION_ID < 70400 && get_magic_quotes_runtime() ); // WP: Patched for PHP 7.4.
if ($magic_quotes) {
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
set_magic_quotes_runtime(false);

0 comments on commit f13714d

Please sign in to comment.
You can’t perform that action at this time.