WordPress.org

Make WordPress Core

Ticket #47783: 47783-2-magic_quotes_deprecation-phpmailer.patch

File 47783-2-magic_quotes_deprecation-phpmailer.patch, 1.1 KB (added by jrf, 7 weeks ago)

Refreshed patch for PHPMailer PHP 7.4 compatibility

  • src/wp-includes/class-phpmailer.php

    From 270fa5d8c98d535b0602c79202afd02fc232dbfa Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Tue, 24 Sep 2019 22:52:33 +0200
    Subject: [PATCH] PHP 7.4 compatibility: patch PHPMailer
    
    ---
     src/wp-includes/class-phpmailer.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/class-phpmailer.php b/src/wp-includes/class-phpmailer.php
    index 8772db2842..7aaa850532 100644
    a b class PHPMailer 
    27122712            if (!self::isPermittedPath($path) or !file_exists($path)) {
    27132713                throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
    27142714            }
    2715             $magic_quotes = get_magic_quotes_runtime();
     2715            $magic_quotes = ( PHP_VERSION_ID < 70400 && get_magic_quotes_runtime() ); // WP: Patched for PHP 7.4.
    27162716            if ($magic_quotes) {
    27172717                if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    27182718                    set_magic_quotes_runtime(false);