Make WordPress Core

Ticket #53114: 53114.patch

File 53114.patch, 3.9 KB (added by ayeshrajans, 3 years ago)
  • src/wp-includes/PHPMailer/PHPMailer.php

    commit cb0fac212560763ef39c3dec1f4b56d52404f845
    Author: Ayesh Karunaratne <ayesh@aye.sh>
    Date:   Thu Apr 29 20:42:01 2021 +0530
    
        Update to PHPMailer 6.4.1
    
    diff --git a/src/wp-includes/PHPMailer/PHPMailer.php b/src/wp-includes/PHPMailer/PHPMailer.php
    index 8b27efc461..25818104e0 100644
    a b class PHPMailer 
    748748     *
    749749     * @var string
    750750     */
    751     const VERSION = '6.4.0';
     751    const VERSION = '6.4.1';
    752752
    753753    /**
    754754     * Error severity: message only, continue processing.
    protected function sendmailSend($header, $body) 
    17231723                fwrite($mail, $header);
    17241724                fwrite($mail, $body);
    17251725                $result = pclose($mail);
     1726                $addrinfo = static::parseAddresses($toAddr);
    17261727                $this->doCallback(
    17271728                    ($result === 0),
    1728                     [$toAddr],
     1729                    [[$addrinfo['address'], $addrinfo['name']]],
    17291730                    $this->cc,
    17301731                    $this->bcc,
    17311732                    $this->Subject,
    protected static function isShellSafe($string) 
    18121813     */
    18131814    protected static function isPermittedPath($path)
    18141815    {
    1815         return !preg_match('#^[a-z]+://#i', $path);
     1816        //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
     1817        return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
    18161818    }
    18171819
    18181820    /**
    protected static function isPermittedPath($path) 
    18241826     */
    18251827    protected static function fileIsAccessible($path)
    18261828    {
     1829        if (!static::isPermittedPath($path)) {
     1830            return false;
     1831        }
    18271832        $readable = file_exists($path);
    18281833        //If not a UNC path (expected to start with \\), check read permission, see #2069
    18291834        if (strpos($path, '\\\\') !== 0) {
    18301835            $readable = $readable && is_readable($path);
    18311836        }
    1832         return static::isPermittedPath($path) && $readable;
     1837        return $readable;
    18331838    }
    18341839
    18351840    /**
    protected function mailSend($header, $body) 
    18781883        if ($this->SingleTo && count($toArr) > 1) {
    18791884            foreach ($toArr as $toAddr) {
    18801885                $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
    1881                 $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
     1886                $addrinfo = static::parseAddresses($toAddr);
     1887                $this->doCallback(
     1888                    $result,
     1889                    [[$addrinfo['address'], $addrinfo['name']]],
     1890                    $this->cc,
     1891                    $this->bcc,
     1892                    $this->Subject,
     1893                    $body,
     1894                    $this->From,
     1895                    []
     1896                );
    18821897            }
    18831898        } else {
    18841899            $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
    protected function smtpSend($header, $body) 
    19671982                    $isSent = true;
    19681983                }
    19691984
    1970                 $callbacks[] = ['issent' => $isSent, 'to' => $to[0]];
     1985                $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
    19711986            }
    19721987        }
    19731988
    protected function smtpSend($header, $body) 
    19882003        foreach ($callbacks as $cb) {
    19892004            $this->doCallback(
    19902005                $cb['issent'],
    1991                 [$cb['to']],
     2006                [[$cb['to'], $cb['name']]],
    19922007                [],
    19932008                [],
    19942009                $this->Subject,
  • src/wp-includes/PHPMailer/SMTP.php

    diff --git a/src/wp-includes/PHPMailer/SMTP.php b/src/wp-includes/PHPMailer/SMTP.php
    index 9d85929ddf..0e7f53df50 100644
    a b class SMTP 
    3535     *
    3636     * @var string
    3737     */
    38     const VERSION = '6.4.0';
     38    const VERSION = '6.4.1';
    3939
    4040    /**
    4141     * SMTP line break constant.