[Web] Update composer libs
- Removing symfony/deprecation-contracts (v2.4.0) - Upgrading ddeboer/imap (1.12.1 => 1.13.1) - Upgrading directorytree/ldaprecord (v2.6.3 => v2.10.1) - Upgrading illuminate/contracts (v8.53.1 => v9.3.0) - Upgrading nesbot/carbon (2.51.1 => 2.57.0) - Upgrading phpmailer/phpmailer (v6.5.0 => v6.6.0) - Upgrading psr/container (1.1.1 => 2.0.2) - Upgrading psr/log (1.1.4 => 3.0.0) - Upgrading psr/simple-cache (1.0.1 => 2.0.0) - Upgrading robthree/twofactorauth (1.8.0 => 1.8.1) - Upgrading symfony/polyfill-ctype (v1.23.0 => v1.24.0) - Upgrading symfony/polyfill-mbstring (v1.23.1 => v1.24.0) - Upgrading symfony/polyfill-php80 (v1.23.1 => v1.24.0) - Upgrading symfony/translation (v5.3.4 => v6.0.5) - Upgrading symfony/translation-contracts (v2.4.0 => v3.0.0) - Upgrading symfony/var-dumper (v5.3.6 => v6.0.5) - Upgrading tightenco/collect (v8.34.0 => v8.83.2) - Upgrading twig/twig (v3.3.2 => v3.3.8)
This commit is contained in:
@@ -35,6 +35,6 @@ class Exception extends \Exception
|
||||
*/
|
||||
public function errorMessage()
|
||||
{
|
||||
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
||||
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ use League\OAuth2\Client\Token\AccessToken;
|
||||
*
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
*/
|
||||
class OAuth
|
||||
class OAuth implements OAuthTokenProvider
|
||||
{
|
||||
/**
|
||||
* An instance of the League OAuth Client Provider.
|
||||
|
44
data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php
vendored
Normal file
44
data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP email creation and transport class.
|
||||
* PHP Version 5.5.
|
||||
*
|
||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||
*
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||
* @author Brent R. Matzelle (original founder)
|
||||
* @copyright 2012 - 2020 Marcus Bointon
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
namespace PHPMailer\PHPMailer;
|
||||
|
||||
/**
|
||||
* OAuthTokenProvider - OAuth2 token provider interface.
|
||||
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
|
||||
*
|
||||
* @see OAuth
|
||||
* @see SMTP::authenticate()
|
||||
*
|
||||
* @author Peter Scopes (pdscopes)
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
*/
|
||||
interface OAuthTokenProvider
|
||||
{
|
||||
/**
|
||||
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
|
||||
* The string to be base 64 encoded should be in the form:
|
||||
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOauth64();
|
||||
}
|
@@ -103,14 +103,14 @@ class PHPMailer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $From = 'root@localhost';
|
||||
public $From = '';
|
||||
|
||||
/**
|
||||
* The From name of the message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $FromName = 'Root User';
|
||||
public $FromName = '';
|
||||
|
||||
/**
|
||||
* The envelope sender of the message.
|
||||
@@ -358,9 +358,9 @@ class PHPMailer
|
||||
public $AuthType = '';
|
||||
|
||||
/**
|
||||
* An instance of the PHPMailer OAuth class.
|
||||
* An implementation of the PHPMailer OAuthTokenProvider interface.
|
||||
*
|
||||
* @var OAuth
|
||||
* @var OAuthTokenProvider
|
||||
*/
|
||||
protected $oauth;
|
||||
|
||||
@@ -689,7 +689,7 @@ class PHPMailer
|
||||
protected $boundary = [];
|
||||
|
||||
/**
|
||||
* The array of available languages.
|
||||
* The array of available text strings for the current language.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
@@ -750,7 +750,7 @@ class PHPMailer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.5.0';
|
||||
const VERSION = '6.6.0';
|
||||
|
||||
/**
|
||||
* Error severity: message only, continue processing.
|
||||
@@ -1185,28 +1185,37 @@ class PHPMailer
|
||||
*
|
||||
* @param string $addrstr The address list string
|
||||
* @param bool $useimap Whether to use the IMAP extension to parse the list
|
||||
* @param string $charset The charset to use when decoding the address list string.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function parseAddresses($addrstr, $useimap = true)
|
||||
public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591)
|
||||
{
|
||||
$addresses = [];
|
||||
if ($useimap && function_exists('imap_rfc822_parse_adrlist')) {
|
||||
//Use this built-in parser if it's available
|
||||
$list = imap_rfc822_parse_adrlist($addrstr, '');
|
||||
// Clear any potential IMAP errors to get rid of notices being thrown at end of script.
|
||||
imap_errors();
|
||||
foreach ($list as $address) {
|
||||
if (
|
||||
('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress(
|
||||
$address->mailbox . '@' . $address->host
|
||||
)
|
||||
'.SYNTAX-ERROR.' !== $address->host &&
|
||||
static::validateAddress($address->mailbox . '@' . $address->host)
|
||||
) {
|
||||
//Decode the name part if it's present and encoded
|
||||
if (
|
||||
property_exists($address, 'personal') &&
|
||||
extension_loaded('mbstring') &&
|
||||
preg_match('/^=\?.*\?=$/', $address->personal)
|
||||
//Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled
|
||||
defined('MB_CASE_UPPER') &&
|
||||
preg_match('/^=\?.*\?=$/s', $address->personal)
|
||||
) {
|
||||
$origCharset = mb_internal_encoding();
|
||||
mb_internal_encoding($charset);
|
||||
//Undo any RFC2047-encoded spaces-as-underscores
|
||||
$address->personal = str_replace('_', '=20', $address->personal);
|
||||
//Decode the name
|
||||
$address->personal = mb_decode_mimeheader($address->personal);
|
||||
mb_internal_encoding($origCharset);
|
||||
}
|
||||
|
||||
$addresses[] = [
|
||||
@@ -1234,9 +1243,16 @@ class PHPMailer
|
||||
$email = trim(str_replace('>', '', $email));
|
||||
$name = trim($name);
|
||||
if (static::validateAddress($email)) {
|
||||
//Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled
|
||||
//If this name is encoded, decode it
|
||||
if (preg_match('/^=\?.*\?=$/', $name)) {
|
||||
if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) {
|
||||
$origCharset = mb_internal_encoding();
|
||||
mb_internal_encoding($charset);
|
||||
//Undo any RFC2047-encoded spaces-as-underscores
|
||||
$name = str_replace('_', '=20', $name);
|
||||
//Decode the name
|
||||
$name = mb_decode_mimeheader($name);
|
||||
mb_internal_encoding($origCharset);
|
||||
}
|
||||
$addresses[] = [
|
||||
//Remove any surrounding quotes and spaces from the name
|
||||
@@ -1436,7 +1452,12 @@ class PHPMailer
|
||||
$errorcode = 0;
|
||||
if (defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||
//Use the current punycode standard (appeared in PHP 7.2)
|
||||
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46);
|
||||
$punycode = idn_to_ascii(
|
||||
$domain,
|
||||
\IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI |
|
||||
\IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII,
|
||||
\INTL_IDNA_VARIANT_UTS46
|
||||
);
|
||||
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
|
||||
//Fall back to this old, deprecated/removed encoding
|
||||
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
|
||||
@@ -1508,12 +1529,7 @@ class PHPMailer
|
||||
&& ini_get('mail.add_x_header') === '1'
|
||||
&& stripos(PHP_OS, 'WIN') === 0
|
||||
) {
|
||||
trigger_error(
|
||||
'Your version of PHP is affected by a bug that may result in corrupted messages.' .
|
||||
' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
|
||||
' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
|
||||
E_USER_WARNING
|
||||
);
|
||||
trigger_error($this->lang('buggy_php'), E_USER_WARNING);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1687,7 +1703,10 @@ class PHPMailer
|
||||
//Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
|
||||
//Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
|
||||
//Example problem: https://www.drupal.org/node/1057954
|
||||
if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) {
|
||||
|
||||
//PHP 5.6 workaround
|
||||
$sendmail_from_value = ini_get('sendmail_from');
|
||||
if (empty($this->Sender) && !empty($sendmail_from_value)) {
|
||||
//PHP config has a sender address we can use
|
||||
$this->Sender = ini_get('sendmail_from');
|
||||
}
|
||||
@@ -1724,7 +1743,7 @@ class PHPMailer
|
||||
fwrite($mail, $header);
|
||||
fwrite($mail, $body);
|
||||
$result = pclose($mail);
|
||||
$addrinfo = static::parseAddresses($toAddr);
|
||||
$addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
|
||||
$this->doCallback(
|
||||
($result === 0),
|
||||
[[$addrinfo['address'], $addrinfo['name']]],
|
||||
@@ -1779,7 +1798,13 @@ class PHPMailer
|
||||
*/
|
||||
protected static function isShellSafe($string)
|
||||
{
|
||||
//Future-proof
|
||||
//It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg,
|
||||
//but some hosting providers disable it, creating a security problem that we don't want to have to deal with,
|
||||
//so we don't.
|
||||
if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
escapeshellcmd($string) !== $string
|
||||
|| !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
|
||||
@@ -1869,7 +1894,10 @@ class PHPMailer
|
||||
//Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
|
||||
//Example problem: https://www.drupal.org/node/1057954
|
||||
//CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
||||
if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) {
|
||||
|
||||
//PHP 5.6 workaround
|
||||
$sendmail_from_value = ini_get('sendmail_from');
|
||||
if (empty($this->Sender) && !empty($sendmail_from_value)) {
|
||||
//PHP config has a sender address we can use
|
||||
$this->Sender = ini_get('sendmail_from');
|
||||
}
|
||||
@@ -1884,7 +1912,7 @@ class PHPMailer
|
||||
if ($this->SingleTo && count($toArr) > 1) {
|
||||
foreach ($toArr as $toAddr) {
|
||||
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
|
||||
$addrinfo = static::parseAddresses($toAddr);
|
||||
$addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
|
||||
$this->doCallback(
|
||||
$result,
|
||||
[[$addrinfo['address'], $addrinfo['name']]],
|
||||
@@ -2133,7 +2161,8 @@ class PHPMailer
|
||||
}
|
||||
if ($tls) {
|
||||
if (!$this->smtp->startTLS()) {
|
||||
throw new Exception($this->lang('connect_host'));
|
||||
$message = $this->getSmtpErrorMessage('connect_host');
|
||||
throw new Exception($message);
|
||||
}
|
||||
//We must resend EHLO after TLS negotiation
|
||||
$this->smtp->hello($hello);
|
||||
@@ -2163,6 +2192,10 @@ class PHPMailer
|
||||
//As we've caught all exceptions, just report whatever the last one was
|
||||
if ($this->exceptions && null !== $lastexception) {
|
||||
throw $lastexception;
|
||||
} elseif ($this->exceptions) {
|
||||
// no exception was thrown, likely $this->smtp->connect() failed
|
||||
$message = $this->getSmtpErrorMessage('connect_host');
|
||||
throw new Exception($message);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -2181,14 +2214,15 @@ class PHPMailer
|
||||
|
||||
/**
|
||||
* Set the language for error messages.
|
||||
* Returns false if it cannot load the language file.
|
||||
* The default language is English.
|
||||
*
|
||||
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
|
||||
* @param string $lang_path Path to the language file directory, with trailing separator (slash).D
|
||||
* Optionally, the language code can be enhanced with a 4-character
|
||||
* script annotation and/or a 2-character country annotation.
|
||||
* @param string $lang_path Path to the language file directory, with trailing separator (slash)
|
||||
* Do not set this from user input!
|
||||
*
|
||||
* @return bool
|
||||
* @return bool Returns true if the requested language was loaded, false otherwise.
|
||||
*/
|
||||
public function setLanguage($langcode = 'en', $lang_path = '')
|
||||
{
|
||||
@@ -2211,44 +2245,77 @@ class PHPMailer
|
||||
//Define full set of translatable strings in English
|
||||
$PHPMAILER_LANG = [
|
||||
'authenticate' => 'SMTP Error: Could not authenticate.',
|
||||
'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' .
|
||||
' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
|
||||
' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
|
||||
'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
|
||||
'data_not_accepted' => 'SMTP Error: data not accepted.',
|
||||
'empty_message' => 'Message body empty',
|
||||
'encoding' => 'Unknown encoding: ',
|
||||
'execute' => 'Could not execute: ',
|
||||
'extension_missing' => 'Extension missing: ',
|
||||
'file_access' => 'Could not access file: ',
|
||||
'file_open' => 'File Error: Could not open file: ',
|
||||
'from_failed' => 'The following From address failed: ',
|
||||
'instantiate' => 'Could not instantiate mail function.',
|
||||
'invalid_address' => 'Invalid address: ',
|
||||
'invalid_header' => 'Invalid header name or value',
|
||||
'invalid_hostentry' => 'Invalid hostentry: ',
|
||||
'invalid_host' => 'Invalid host: ',
|
||||
'mailer_not_supported' => ' mailer is not supported.',
|
||||
'provide_address' => 'You must provide at least one recipient email address.',
|
||||
'recipients_failed' => 'SMTP Error: The following recipients failed: ',
|
||||
'signing' => 'Signing Error: ',
|
||||
'smtp_code' => 'SMTP code: ',
|
||||
'smtp_code_ex' => 'Additional SMTP info: ',
|
||||
'smtp_connect_failed' => 'SMTP connect() failed.',
|
||||
'smtp_detail' => 'Detail: ',
|
||||
'smtp_error' => 'SMTP server error: ',
|
||||
'variable_set' => 'Cannot set or reset variable: ',
|
||||
'extension_missing' => 'Extension missing: ',
|
||||
];
|
||||
if (empty($lang_path)) {
|
||||
//Calculate an absolute path so it can work if CWD is not here
|
||||
$lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
//Validate $langcode
|
||||
if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
|
||||
$foundlang = true;
|
||||
$langcode = strtolower($langcode);
|
||||
if (
|
||||
!preg_match('/^(?P<lang>[a-z]{2})(?P<script>_[a-z]{4})?(?P<country>_[a-z]{2})?$/', $langcode, $matches)
|
||||
&& $langcode !== 'en'
|
||||
) {
|
||||
$foundlang = false;
|
||||
$langcode = 'en';
|
||||
}
|
||||
$foundlang = true;
|
||||
$lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
|
||||
|
||||
//There is no English translation file
|
||||
if ('en' !== $langcode) {
|
||||
//Make sure language file path is readable
|
||||
if (!static::fileIsAccessible($lang_file)) {
|
||||
$langcodes = [];
|
||||
if (!empty($matches['script']) && !empty($matches['country'])) {
|
||||
$langcodes[] = $matches['lang'] . $matches['script'] . $matches['country'];
|
||||
}
|
||||
if (!empty($matches['country'])) {
|
||||
$langcodes[] = $matches['lang'] . $matches['country'];
|
||||
}
|
||||
if (!empty($matches['script'])) {
|
||||
$langcodes[] = $matches['lang'] . $matches['script'];
|
||||
}
|
||||
$langcodes[] = $matches['lang'];
|
||||
|
||||
//Try and find a readable language file for the requested language.
|
||||
$foundFile = false;
|
||||
foreach ($langcodes as $code) {
|
||||
$lang_file = $lang_path . 'phpmailer.lang-' . $code . '.php';
|
||||
if (static::fileIsAccessible($lang_file)) {
|
||||
$foundFile = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($foundFile === false) {
|
||||
$foundlang = false;
|
||||
} else {
|
||||
//$foundlang = include $lang_file;
|
||||
$lines = file($lang_file);
|
||||
foreach ($lines as $line) {
|
||||
//Translation file lines look like this:
|
||||
@@ -2283,6 +2350,10 @@ class PHPMailer
|
||||
*/
|
||||
public function getTranslations()
|
||||
{
|
||||
if (empty($this->language)) {
|
||||
$this->setLanguage(); // Set the default language.
|
||||
}
|
||||
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
@@ -2551,7 +2622,17 @@ class PHPMailer
|
||||
|
||||
//Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
||||
//https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||
if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) {
|
||||
if (
|
||||
'' !== $this->MessageID &&
|
||||
preg_match(
|
||||
'/^<((([a-z\d!#$%&\'*+\/=?^_`{|}~-]+(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)' .
|
||||
'|("(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21\x23-\x5B\x5D-\x7E])' .
|
||||
'|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*"))@(([a-z\d!#$%&\'*+\/=?^_`{|}~-]+' .
|
||||
'(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)|(\[(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]' .
|
||||
'|[\x21-\x5A\x5E-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*\])))>$/Di',
|
||||
$this->MessageID
|
||||
)
|
||||
) {
|
||||
$this->lastMessageID = $this->MessageID;
|
||||
} else {
|
||||
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
|
||||
@@ -2561,16 +2642,15 @@ class PHPMailer
|
||||
$result .= $this->headerLine('X-Priority', $this->Priority);
|
||||
}
|
||||
if ('' === $this->XMailer) {
|
||||
//Empty string for default X-Mailer header
|
||||
$result .= $this->headerLine(
|
||||
'X-Mailer',
|
||||
'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)'
|
||||
);
|
||||
} else {
|
||||
$myXmailer = trim($this->XMailer);
|
||||
if ($myXmailer) {
|
||||
$result .= $this->headerLine('X-Mailer', $myXmailer);
|
||||
}
|
||||
}
|
||||
} elseif (is_string($this->XMailer) && trim($this->XMailer) !== '') {
|
||||
//Some string
|
||||
$result .= $this->headerLine('X-Mailer', trim($this->XMailer));
|
||||
} //Other values result in no X-Mailer header
|
||||
|
||||
if ('' !== $this->ConfirmReadingTo) {
|
||||
$result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
|
||||
@@ -3935,13 +4015,13 @@ class PHPMailer
|
||||
if (!empty($lasterror['error'])) {
|
||||
$msg .= $this->lang('smtp_error') . $lasterror['error'];
|
||||
if (!empty($lasterror['detail'])) {
|
||||
$msg .= ' Detail: ' . $lasterror['detail'];
|
||||
$msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
|
||||
}
|
||||
if (!empty($lasterror['smtp_code'])) {
|
||||
$msg .= ' SMTP code: ' . $lasterror['smtp_code'];
|
||||
$msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code'];
|
||||
}
|
||||
if (!empty($lasterror['smtp_code_ex'])) {
|
||||
$msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
|
||||
$msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4002,7 +4082,7 @@ class PHPMailer
|
||||
empty($host)
|
||||
|| !is_string($host)
|
||||
|| strlen($host) > 256
|
||||
|| !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host)
|
||||
|| !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -4052,6 +4132,26 @@ class PHPMailer
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an error message starting with a generic one and adding details if possible.
|
||||
*
|
||||
* @param string $base_key
|
||||
* @return string
|
||||
*/
|
||||
private function getSmtpErrorMessage($base_key)
|
||||
{
|
||||
$message = $this->lang($base_key);
|
||||
$error = $this->smtp->getError();
|
||||
if (!empty($error['error'])) {
|
||||
$message .= ' ' . $error['error'];
|
||||
if (!empty($error['detail'])) {
|
||||
$message .= ' ' . $error['detail'];
|
||||
}
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an error occurred.
|
||||
*
|
||||
@@ -4079,11 +4179,11 @@ class PHPMailer
|
||||
list($name, $value) = explode(':', $name, 2);
|
||||
}
|
||||
$name = trim($name);
|
||||
$value = trim($value);
|
||||
$value = (null === $value) ? '' : trim($value);
|
||||
//Ensure name is not empty, and that neither name nor value contain line breaks
|
||||
if (empty($name) || strpbrk($name . $value, "\r\n") !== false) {
|
||||
if ($this->exceptions) {
|
||||
throw new Exception('Invalid header name or value');
|
||||
throw new Exception($this->lang('invalid_header'));
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -4237,7 +4337,8 @@ class PHPMailer
|
||||
*
|
||||
* @param string $html The HTML text to convert
|
||||
* @param bool|callable $advanced Any boolean value to use the internal converter,
|
||||
* or provide your own callable for custom conversion
|
||||
* or provide your own callable for custom conversion.
|
||||
* *Never* pass user-supplied data into this parameter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -4951,9 +5052,9 @@ class PHPMailer
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the OAuth instance.
|
||||
* Get the OAuthTokenProvider instance.
|
||||
*
|
||||
* @return OAuth
|
||||
* @return OAuthTokenProvider
|
||||
*/
|
||||
public function getOAuth()
|
||||
{
|
||||
@@ -4961,9 +5062,9 @@ class PHPMailer
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an OAuth instance.
|
||||
* Set an OAuthTokenProvider instance.
|
||||
*/
|
||||
public function setOAuth(OAuth $oauth)
|
||||
public function setOAuth(OAuthTokenProvider $oauth)
|
||||
{
|
||||
$this->oauth = $oauth;
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class POP3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.5.0';
|
||||
const VERSION = '6.6.0';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
@@ -308,6 +308,7 @@ class POP3
|
||||
{
|
||||
if (!$this->connected) {
|
||||
$this->setError('Not connected to POP3 server');
|
||||
return false;
|
||||
}
|
||||
if (empty($username)) {
|
||||
$username = $this->username;
|
||||
@@ -337,6 +338,15 @@ class POP3
|
||||
public function disconnect()
|
||||
{
|
||||
$this->sendString('QUIT');
|
||||
|
||||
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
|
||||
// Try to get it. Ignore any failures here.
|
||||
try {
|
||||
$this->getResponse();
|
||||
} catch (Exception $e) {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||
//So ignore errors here
|
||||
try {
|
||||
@@ -344,6 +354,10 @@ class POP3
|
||||
} catch (Exception $e) {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
// Clean up attributes.
|
||||
$this->connected = false;
|
||||
$this->pop_conn = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -35,7 +35,7 @@ class SMTP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.5.0';
|
||||
const VERSION = '6.6.0';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@@ -187,6 +187,7 @@ class SMTP
|
||||
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
||||
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
||||
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
|
||||
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -392,7 +393,6 @@ class SMTP
|
||||
STREAM_CLIENT_CONNECT,
|
||||
$socket_context
|
||||
);
|
||||
restore_error_handler();
|
||||
} else {
|
||||
//Fall back to fsockopen which should work in more places, but is missing some features
|
||||
$this->edebug(
|
||||
@@ -407,8 +407,8 @@ class SMTP
|
||||
$errstr,
|
||||
$timeout
|
||||
);
|
||||
restore_error_handler();
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
//Verify we connected properly
|
||||
if (!is_resource($connection)) {
|
||||
@@ -483,7 +483,7 @@ class SMTP
|
||||
* @param string $username The user name
|
||||
* @param string $password The password
|
||||
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
|
||||
* @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication
|
||||
* @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication
|
||||
*
|
||||
* @return bool True if successfully authenticated
|
||||
*/
|
||||
@@ -696,7 +696,7 @@ class SMTP
|
||||
/**
|
||||
* Send an SMTP DATA command.
|
||||
* Issues a data command and sends the msg_data to the server,
|
||||
* finializing the mail transaction. $msg_data is the message
|
||||
* finalizing the mail transaction. $msg_data is the message
|
||||
* that is to be send with the headers. Each header needs to be
|
||||
* on a single line followed by a <CRLF> with the message headers
|
||||
* and the message body being separated by an additional <CRLF>.
|
||||
@@ -1170,7 +1170,7 @@ class SMTP
|
||||
if (!$this->server_caps) {
|
||||
$this->setError('No HELO/EHLO was sent');
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!array_key_exists($name, $this->server_caps)) {
|
||||
@@ -1182,7 +1182,7 @@ class SMTP
|
||||
}
|
||||
$this->setError('HELO handshake was used; No information about server extensions available');
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->server_caps[$name];
|
||||
|
Reference in New Issue
Block a user