Changeset 61468 for trunk/src/wp-includes/PHPMailer/SMTP.php
- Timestamp:
- 01/10/2026 11:50:11 PM (7 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/PHPMailer/SMTP.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/PHPMailer/SMTP.php
r61249 r61468 35 35 * 36 36 * @var string 37 */ 38 const VERSION = '7.0.0'; 37 * @deprecated This constant will be removed in PHPMailer 8.0. Use `PHPMailer::VERSION` instead. 38 */ 39 const VERSION = '7.0.2'; 39 40 40 41 /** … … 495 496 //so add them back in manually if we can 496 497 if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { 498 // phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_2_clientFound 497 499 $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; 500 // phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_1_clientFound 498 501 $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; 499 502 } … … 634 637 return false; 635 638 } 636 $oauth = $OAuth->getOauth64(); 639 try { 640 $oauth = $OAuth->getOauth64(); 641 } catch (\Exception $e) { 642 // We catch all exceptions and convert them to PHPMailer exceptions to be able to 643 // handle them correctly later 644 throw new Exception("SMTP authentication error", 0, $e); 645 } 637 646 /* 638 647 * An SMTP command line can have a maximum length of 512 bytes, including the command name, … … 762 771 } 763 772 773 private function iterateLines($s) 774 { 775 $start = 0; 776 $length = strlen($s); 777 778 for ($i = 0; $i < $length; $i++) { 779 $c = $s[$i]; 780 if ($c === "\n" || $c === "\r") { 781 yield substr($s, $start, $i - $start); 782 if ($c === "\r" && $i + 1 < $length && $s[$i + 1] === "\n") { 783 $i++; 784 } 785 $start = $i + 1; 786 } 787 } 788 789 yield substr($s, $start); 790 } 791 764 792 /** 765 793 * Send an SMTP DATA command. … … 790 818 */ 791 819 792 // Normalize line breaks before exploding793 $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));820 //Iterate over lines with normalized line breaks 821 $lines = $this->iterateLines($msg_data); 794 822 795 823 /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field … … 798 826 */ 799 827 800 $field = substr($lines[0], 0, strpos($lines[0], ':')); 828 $first_line = $lines->current(); 829 $field = substr($first_line, 0, strpos($first_line, ':')); 801 830 $in_headers = false; 802 831 if (!empty($field) && strpos($field, ' ') === false) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)