Changeset 52811
- Timestamp:
- 02/28/2022 09:36:22 PM (3 years ago)
- Location:
- trunk/src/wp-includes/PHPMailer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/PHPMailer/PHPMailer.php
r52749 r52811 359 359 360 360 /** 361 * An i nstance of the PHPMailer OAuth class.362 * 363 * @var OAuth 361 * An implementation of the PHPMailer OAuthTokenProvider interface. 362 * 363 * @var OAuthTokenProvider 364 364 */ 365 365 protected $oauth; … … 751 751 * @var string 752 752 */ 753 const VERSION = '6. 5.4';753 const VERSION = '6.6.0'; 754 754 755 755 /** … … 2164 2164 if ($tls) { 2165 2165 if (!$this->smtp->startTLS()) { 2166 throw new Exception($this->lang('connect_host')); 2166 $message = $this->getSmtpErrorMessage('connect_host'); 2167 throw new Exception($message); 2167 2168 } 2168 2169 //We must resend EHLO after TLS negotiation … … 2194 2195 if ($this->exceptions && null !== $lastexception) { 2195 2196 throw $lastexception; 2197 } elseif ($this->exceptions) { 2198 // no exception was thrown, likely $this->smtp->connect() failed 2199 $message = $this->getSmtpErrorMessage('connect_host'); 2200 throw new Exception($message); 2196 2201 } 2197 2202 … … 4131 4136 4132 4137 /** 4138 * Build an error message starting with a generic one and adding details if possible. 4139 * 4140 * @param string $base_key 4141 * @return string 4142 */ 4143 private function getSmtpErrorMessage($base_key) 4144 { 4145 $message = $this->lang($base_key); 4146 $error = $this->smtp->getError(); 4147 if (!empty($error['error'])) { 4148 $message .= ' ' . $error['error']; 4149 if (!empty($error['detail'])) { 4150 $message .= ' ' . $error['detail']; 4151 } 4152 } 4153 4154 return $message; 4155 } 4156 4157 /** 4133 4158 * Check if an error occurred. 4134 4159 * … … 5030 5055 5031 5056 /** 5032 * Get the OAuth instance.5033 * 5034 * @return OAuth 5057 * Get the OAuthTokenProvider instance. 5058 * 5059 * @return OAuthTokenProvider 5035 5060 */ 5036 5061 public function getOAuth() … … 5040 5065 5041 5066 /** 5042 * Set an OAuth instance.5043 */ 5044 public function setOAuth(OAuth $oauth)5067 * Set an OAuthTokenProvider instance. 5068 */ 5069 public function setOAuth(OAuthTokenProvider $oauth) 5045 5070 { 5046 5071 $this->oauth = $oauth; -
trunk/src/wp-includes/PHPMailer/SMTP.php
r52749 r52811 36 36 * @var string 37 37 */ 38 const VERSION = '6. 5.4';38 const VERSION = '6.6.0'; 39 39 40 40 /** … … 484 484 * @param string $password The password 485 485 * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) 486 * @param OAuth $OAuth An optional OAuthinstance for XOAUTH2 authentication486 * @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication 487 487 * 488 488 * @return bool True if successfully authenticated
Note: See TracChangeset
for help on using the changeset viewer.