Make WordPress Core

Changeset 54937


Ignore:
Timestamp:
12/06/2022 12:17:12 PM (17 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Upgrade PHPMailer to version 6.7.

This is a bug fix release which also contains some PHP 8.1 related improvements.

References:

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

Props jrf, Synchro.
Fixes #57281.

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

Legend:

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

    r54427 r54937  
    751751     * @var string
    752752     */
    753     const VERSION = '6.6.5';
     753    const VERSION = '6.7';
    754754
    755755    /**
     
    859859    {
    860860        //Check overloading of mail function to avoid double-encoding
    861         if (ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
     861        if ((int)ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
    862862            $subject = $this->secureHeader($subject);
    863863        } else {
     
    11231123        //Immediately add standard addresses without IDN.
    11241124        return call_user_func_array([$this, 'addAnAddress'], $params);
     1125    }
     1126
     1127    /**
     1128     * Set the boundaries to use for delimiting MIME parts.
     1129     * If you override this, ensure you set all 3 boundaries to unique values.
     1130     * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies,
     1131     * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7
     1132     *
     1133     * @return void
     1134     */
     1135    public function setBoundaries()
     1136    {
     1137        $this->uniqueid = $this->generateId();
     1138        $this->boundary[1] = 'b1=_' . $this->uniqueid;
     1139        $this->boundary[2] = 'b2=_' . $this->uniqueid;
     1140        $this->boundary[3] = 'b3=_' . $this->uniqueid;
    11251141    }
    11261142
     
    16741690            }
    16751691        } catch (Exception $exc) {
     1692            $this->setError($exc->getMessage());
     1693            $this->edebug($exc->getMessage());
    16761694            if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) {
    16771695                $this->smtp->reset();
    16781696            }
    1679             $this->setError($exc->getMessage());
    1680             $this->edebug($exc->getMessage());
    16811697            if ($this->exceptions) {
    16821698                throw $exc;
     
    27972813        $body = '';
    27982814        //Create unique IDs and preset boundaries
    2799         $this->uniqueid = $this->generateId();
    2800         $this->boundary[1] = 'b1_' . $this->uniqueid;
    2801         $this->boundary[2] = 'b2_' . $this->uniqueid;
    2802         $this->boundary[3] = 'b3_' . $this->uniqueid;
     2815        $this->setBoundaries();
    28032816
    28042817        if ($this->sign_key_file) {
     
    28362849        }
    28372850        //Use this as a preamble in all multipart message types
    2838         $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE;
     2851        $mimepre = '';
    28392852        switch ($this->message_type) {
    28402853            case 'inline':
     
    30733086
    30743087    /**
     3088     * Get the boundaries that this message will use
     3089     * @return array
     3090     */
     3091    public function getBoundaries()
     3092    {
     3093        if (empty($this->boundary)) {
     3094            $this->setBoundaries();
     3095        }
     3096        return $this->boundary;
     3097    }
     3098
     3099    /**
    30753100     * Return the start of a message boundary.
    30763101     *
     
    41894214     * @param string|null $value Header value
    41904215     *
     4216     * @return bool True if a header was set successfully
    41914217     * @throws Exception
    41924218     */
     
    46384664
    46394665    /**
    4640      * Remove trailing breaks from a string.
     4666     * Remove trailing whitespace from a string.
    46414667     *
    46424668     * @param string $text
    46434669     *
     4670     * @return string The text to remove whitespace from
     4671     */
     4672    public static function stripTrailingWSP($text)
     4673    {
     4674        return rtrim($text, " \r\n\t");
     4675    }
     4676
     4677    /**
     4678     * Strip trailing line breaks from a string.
     4679     *
     4680     * @param string $text
     4681     *
    46444682     * @return string The text to remove breaks from
    46454683     */
    4646     public static function stripTrailingWSP($text)
    4647     {
    4648         return rtrim($text, " \r\n\t");
     4684    public static function stripTrailingBreaks($text)
     4685    {
     4686        return rtrim($text, "\r\n");
    46494687    }
    46504688
     
    48124850
    48134851        //Reduce multiple trailing line breaks to a single one
    4814         return static::stripTrailingWSP($body) . self::CRLF;
     4852        return static::stripTrailingBreaks($body) . self::CRLF;
    48154853    }
    48164854
  • trunk/src/wp-includes/PHPMailer/SMTP.php

    r54427 r54937  
    3636     * @var string
    3737     */
    38     const VERSION = '6.6.5';
     38    const VERSION = '6.7';
    3939
    4040    /**
Note: See TracChangeset for help on using the changeset viewer.