Make WordPress Core

Changeset 59246


Ignore:
Timestamp:
10/17/2024 11:29:17 AM (3 weeks ago)
Author:
SergeyBiryukov
Message:

External Libraries: Upgrade PHPMailer to version 6.9.2.

This is a maintenance release with minor bug fixes.

References:

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937], [55557], [56484], [57137].

Props ayeshrajans.
Fixes #62206.

Location:
trunk/src/wp-includes/PHPMailer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/PHPMailer/Exception.php

    r51634 r59246  
    1414 * @copyright 2010 - 2012 Jim Jagielski
    1515 * @copyright 2004 - 2009 Andy Prevost
    16  * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     16 * @license   https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
    1717 * @note      This program is distributed in the hope that it will be useful - WITHOUT
    1818 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  • trunk/src/wp-includes/PHPMailer/PHPMailer.php

    r57137 r59246  
    1414 * @copyright 2010 - 2012 Jim Jagielski
    1515 * @copyright 2004 - 2009 Andy Prevost
    16  * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     16 * @license   https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
    1717 * @note      This program is distributed in the hope that it will be useful - WITHOUT
    1818 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     
    153153     * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator.
    154154     *
    155      * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
    156      * @see http://kigkonsult.se/iCalcreator/
     155     * @see https://kigkonsult.se/iCalcreator/
    157156     *
    158157     * @var string
     
    359358
    360359    /**
    361      * SMTP SMTPXClient command attibutes
     360     * SMTP SMTPXClient command attributes
    362361     *
    363362     * @var array
     
    469468     *
    470469     * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
    471      * @see http://www.postfix.org/VERP_README.html Postfix VERP info
     470     * @see https://www.postfix.org/VERP_README.html Postfix VERP info
    472471     *
    473472     * @var bool
     
    552551     * It is called out by send() for each email sent.
    553552     *
    554      * Value can be any php callable: http://www.php.net/is_callable
     553     * Value can be any php callable: https://www.php.net/is_callable
    555554     *
    556555     * Parameters:
    557      *   bool $result        result of the send action
     556     *   bool $result           result of the send action
    558557     *   array   $to            email addresses of the recipients
    559558     *   array   $cc            cc email addresses
     
    758757     * @var string
    759758     */
    760     const VERSION = '6.9.1';
     759    const VERSION = '6.9.2';
    761760
    762761    /**
     
    904903        //Is this a PSR-3 logger?
    905904        if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
    906             $this->Debugoutput->debug($str);
     905            $this->Debugoutput->debug(rtrim($str, "\r\n"));
    907906
    908907            return;
     
    10731072     * Addresses that have been added already return false, but do not throw exceptions.
    10741073     *
    1075      * @param string $kind    One of 'to', 'cc', 'bcc', or 'ReplyTo'
     1074     * @param string $kind    One of 'to', 'cc', 'bcc', or 'Reply-To'
    10761075     * @param string $address The email address
    10771076     * @param string $name    An optional username associated with the address
     
    12131212     * Note that quotes in the name part are removed.
    12141213     *
    1215      * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
     1214     * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
    12161215     *
    12171216     * @param string $addrstr The address list string
     
    14081407                 * Not all of these will necessarily work for sending!
    14091408                 *
    1410                  * @see       http://squiloople.com/2009/12/20/email-address-validation/
    14111409                 * @copyright 2009-2010 Michael Rushton
    14121410                 * Feel free to use and redistribute this code. But please keep this copyright notice.
     
    17371735        //A space after `-f` is optional, but there is a long history of its presence
    17381736        //causing problems, so we don't use one
    1739         //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
    1740         //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
    1741         //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
     1737        //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
     1738        //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
    17421739        //Example problem: https://www.drupal.org/node/1057954
    17431740
     
    19041901     * Send mail using the PHP mail() function.
    19051902     *
    1906      * @see http://www.php.net/manual/en/book.mail.php
     1903     * @see https://www.php.net/manual/en/book.mail.php
    19071904     *
    19081905     * @param string $header The message headers
     
    19341931        //A space after `-f` is optional, but there is a long history of its presence
    19351932        //causing problems, so we don't use one
    1936         //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
    1937         //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
    1938         //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
     1933        //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
     1934        //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
    19391935        //Example problem: https://www.drupal.org/node/1057954
    19401936        //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
     
    36373633     * Adapted from a function by paravoid.
    36383634     *
    3639      * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
     3635     * @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
    36403636     *
    36413637     * @param string $str       multi-byte text to wrap encode
     
    36933689     * Encode a string using Q encoding.
    36943690     *
    3695      * @see http://tools.ietf.org/html/rfc2047#section-4.2
     3691     * @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2
    36963692     *
    36973693     * @param string $str      the text to encode
     
    42314227        } elseif (function_exists('gethostname') && gethostname() !== false) {
    42324228            $result = gethostname();
    4233         } elseif (php_uname('n') !== false) {
     4229        } elseif (php_uname('n') !== '') {
    42344230            $result = php_uname('n');
    42354231        }
     
    42564252            || !is_string($host)
    42574253            || strlen($host) > 256
    4258             || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host)
     4254            || !preg_match('/^([a-z\d.-]*|\[[a-f\d:]+\])$/i', $host)
    42594255        ) {
    42604256            return false;
     
    42704266            return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
    42714267        }
    4272         //Is it a syntactically valid hostname (when embeded in a URL)?
    4273         return filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false;
     4268        //Is it a syntactically valid hostname (when embedded in a URL)?
     4269        return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false;
    42744270    }
    42754271
     
    46824678     * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.
    46834679     *
    4684      * @see http://www.php.net/manual/en/function.pathinfo.php#107461
     4680     * @see https://www.php.net/manual/en/function.pathinfo.php#107461
    46854681     *
    46864682     * @param string     $path    A filename or path, does not need to exist as a file
  • trunk/src/wp-includes/PHPMailer/SMTP.php

    r57137 r59246  
    1414 * @copyright 2010 - 2012 Jim Jagielski
    1515 * @copyright 2004 - 2009 Andy Prevost
    16  * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     16 * @license   https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
    1717 * @note      This program is distributed in the hope that it will be useful - WITHOUT
    1818 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     
    3636     * @var string
    3737     */
    38     const VERSION = '6.9.1';
     38    const VERSION = '6.9.2';
    3939
    4040    /**
     
    153153     * Whether to use VERP.
    154154     *
    155      * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path
    156      * @see http://www.postfix.org/VERP_README.html Info on VERP
     155     * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
     156     * @see https://www.postfix.org/VERP_README.html Info on VERP
    157157     *
    158158     * @var bool
     
    165165     * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
    166166     *
    167      * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2
     167     * @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2
    168168     *
    169169     * @var int
     
    188188    protected $smtp_transaction_id_patterns = [
    189189        'exim' => '/[\d]{3} OK id=(.*)/',
    190         'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/',
    191         'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/',
    192         'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/',
     190        'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/',
     191        'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/',
     192        'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/',
    193193        'Amazon_SES' => '/[\d]{3} Ok (.*)/',
    194194        'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
    195         'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
     195        'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/',
    196196        'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
    197197        'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
     
    281281        //Is this a PSR-3 logger?
    282282        if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
    283             $this->Debugoutput->debug($str);
     283            //Remove trailing line breaks potentially added by calls to SMTP::client_send()
     284            $this->Debugoutput->debug(rtrim($str, "\r\n"));
    284285
    285286            return;
     
    294295            case 'error_log':
    295296                //Don't output, just log
     297                /** @noinspection ForgottenDebugOutputInspection */
    296298                error_log($str);
    297299                break;
     
    405407        if ($streamok) {
    406408            $socket_context = stream_context_create($options);
    407             set_error_handler([$this, 'errorHandler']);
     409            set_error_handler(function () {
     410                call_user_func_array([$this, 'errorHandler'], func_get_args());
     411            });
    408412            $connection = stream_socket_client(
    409413                $host . ':' . $port,
     
    420424                self::DEBUG_CONNECTION
    421425            );
    422             set_error_handler([$this, 'errorHandler']);
     426            set_error_handler(function () {
     427                call_user_func_array([$this, 'errorHandler'], func_get_args());
     428            });
    423429            $connection = fsockopen(
    424430                $host,
     
    484490
    485491        //Begin encrypted connection
    486         set_error_handler([$this, 'errorHandler']);
     492            set_error_handler(function () {
     493                call_user_func_array([$this, 'errorHandler'], func_get_args());
     494            });
    487495        $crypto_ok = stream_socket_enable_crypto(
    488496            $this->smtp_conn,
     
    649657
    650658        //The following borrowed from
    651         //http://php.net/manual/en/function.mhash.php#27225
     659        //https://www.php.net/manual/en/function.mhash.php#27225
    652660
    653661        //RFC 2104 HMAC implementation for php.
     
    11631171            $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
    11641172        }
    1165         set_error_handler([$this, 'errorHandler']);
     1173        set_error_handler(function () {
     1174            call_user_func_array([$this, 'errorHandler'], func_get_args());
     1175        });
    11661176        $result = fwrite($this->smtp_conn, $data);
    11671177        restore_error_handler();
     
    12661276            //Must pass vars in here as params are by reference
    12671277            //solution for signals inspired by https://github.com/symfony/symfony/pull/6540
    1268             set_error_handler([$this, 'errorHandler']);
     1278            set_error_handler(function () {
     1279                call_user_func_array([$this, 'errorHandler'], func_get_args());
     1280            });
    12691281            $n = stream_select($selR, $selW, $selW, $this->Timelimit);
    12701282            restore_error_handler();
Note: See TracChangeset for help on using the changeset viewer.