mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 00:41:52 +02:00
HybridAuth updated to v3.11.0. PHPMailer updated to v6.9.1.
This commit is contained in:
29
e107_handlers/vendor/composer/installed.json
vendored
29
e107_handlers/vendor/composer/installed.json
vendored
@@ -110,17 +110,17 @@
|
||||
},
|
||||
{
|
||||
"name": "hybridauth/hybridauth",
|
||||
"version": "v3.10.0",
|
||||
"version_normalized": "3.10.0.0",
|
||||
"version": "v3.11.0",
|
||||
"version_normalized": "3.11.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/hybridauth/hybridauth.git",
|
||||
"reference": "9b5e8a7782b630d5b1151003999d6db91a863ffe"
|
||||
"reference": "b70b9cbe1c7fa99b5847c5868610a8f024cc7d38"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/9b5e8a7782b630d5b1151003999d6db91a863ffe",
|
||||
"reference": "9b5e8a7782b630d5b1151003999d6db91a863ffe",
|
||||
"url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/b70b9cbe1c7fa99b5847c5868610a8f024cc7d38",
|
||||
"reference": "b70b9cbe1c7fa99b5847c5868610a8f024cc7d38",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -134,7 +134,7 @@
|
||||
"firebase/php-jwt": "Needed to support Apple provider",
|
||||
"phpseclib/phpseclib": "Needed to support Apple provider"
|
||||
},
|
||||
"time": "2023-07-25T15:02:07+00:00",
|
||||
"time": "2024-01-02T23:09:56+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@@ -169,7 +169,7 @@
|
||||
"support": {
|
||||
"gitter": "https://gitter.im/hybridauth/hybridauth",
|
||||
"issues": "https://github.com/hybridauth/hybridauth/issues",
|
||||
"source": "https://github.com/hybridauth/hybridauth/tree/v3.10.0"
|
||||
"source": "https://github.com/hybridauth/hybridauth/tree/v3.11.0"
|
||||
},
|
||||
"install-path": "../hybridauth/hybridauth"
|
||||
},
|
||||
@@ -454,17 +454,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.8.1",
|
||||
"version_normalized": "6.8.1.0",
|
||||
"version": "v6.9.1",
|
||||
"version_normalized": "6.9.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "e88da8d679acc3824ff231fdc553565b802ac016"
|
||||
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016",
|
||||
"reference": "e88da8d679acc3824ff231fdc553565b802ac016",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -484,6 +484,7 @@
|
||||
"yoast/phpunit-polyfills": "^1.0.4"
|
||||
},
|
||||
"suggest": {
|
||||
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
|
||||
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
|
||||
@@ -493,7 +494,7 @@
|
||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
||||
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
|
||||
},
|
||||
"time": "2023-08-29T08:26:30+00:00",
|
||||
"time": "2023-11-25T22:23:28+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@@ -525,7 +526,7 @@
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.1"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
16
e107_handlers/vendor/composer/installed.php
vendored
16
e107_handlers/vendor/composer/installed.php
vendored
@@ -3,7 +3,7 @@
|
||||
'name' => 'e107inc/e107',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '34ba78023cb1fe91319bef6dc47592105cdff8f4',
|
||||
'reference' => 'a27b9de56056e1a7c508980cd6c47a96cb877e09',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../../',
|
||||
'aliases' => array(),
|
||||
@@ -13,7 +13,7 @@
|
||||
'e107inc/e107' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '34ba78023cb1fe91319bef6dc47592105cdff8f4',
|
||||
'reference' => 'a27b9de56056e1a7c508980cd6c47a96cb877e09',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../../',
|
||||
'aliases' => array(),
|
||||
@@ -29,9 +29,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'hybridauth/hybridauth' => array(
|
||||
'pretty_version' => 'v3.10.0',
|
||||
'version' => '3.10.0.0',
|
||||
'reference' => '9b5e8a7782b630d5b1151003999d6db91a863ffe',
|
||||
'pretty_version' => 'v3.11.0',
|
||||
'version' => '3.11.0.0',
|
||||
'reference' => 'b70b9cbe1c7fa99b5847c5868610a8f024cc7d38',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../hybridauth/hybridauth',
|
||||
'aliases' => array(),
|
||||
@@ -74,9 +74,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'phpmailer/phpmailer' => array(
|
||||
'pretty_version' => 'v6.8.1',
|
||||
'version' => '6.8.1.0',
|
||||
'reference' => 'e88da8d679acc3824ff231fdc553565b802ac016',
|
||||
'pretty_version' => 'v6.9.1',
|
||||
'version' => '6.9.1.0',
|
||||
'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
||||
'aliases' => array(),
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[](https://supportukrainenow.org/)
|
||||
|
||||
## [Hybridauth](https://hybridauth.github.io/) 3.10
|
||||
## [Hybridauth](https://hybridauth.github.io/) 3.11
|
||||
|
||||
[](https://travis-ci.org/hybridauth/hybridauth) [](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [](https://packagist.org/packages/hybridauth/hybridauth) [](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
|
@@ -425,8 +425,9 @@ abstract class OAuth2 extends AbstractAdapter implements AdapterInterface
|
||||
* http://tools.ietf.org/html/rfc6749#section-4.1.1
|
||||
*/
|
||||
if ($this->supportRequestState
|
||||
&& $this->getStoredData('authorization_state') != $state
|
||||
&& (!$state || $this->getStoredData('authorization_state') != $state)
|
||||
) {
|
||||
$this->deleteStoredData('authorization_state');
|
||||
throw new InvalidAuthorizationStateException(
|
||||
'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] '
|
||||
. 'of this page is either invalid or has already been consumed.'
|
||||
|
@@ -7,12 +7,12 @@
|
||||
|
||||
namespace Hybridauth\Provider;
|
||||
|
||||
use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
use Hybridauth\Adapter\OpenID;
|
||||
|
||||
/**
|
||||
* AOL OpenID provider adapter.
|
||||
*/
|
||||
class AOLOpenID extends OpenIDAdapter
|
||||
class AOLOpenID extends OpenID
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@@ -244,9 +244,11 @@ class Apple extends OAuth2
|
||||
$user = new Data\Collection($objUser);
|
||||
if (!$user->isEmpty()) {
|
||||
$name = $user->get('name');
|
||||
$userProfile->firstName = $name->firstName;
|
||||
$userProfile->lastName = $name->lastName;
|
||||
$userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]);
|
||||
if (!empty($name->firstName)) {
|
||||
$userProfile->firstName = $name->firstName;
|
||||
$userProfile->lastName = $name->lastName;
|
||||
$userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Hybridauth\Provider;
|
||||
|
||||
use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
use Hybridauth\Adapter;
|
||||
|
||||
/**
|
||||
* Generic OpenID providers adapter.
|
||||
@@ -39,6 +39,6 @@ use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
* echo $e->getMessage() ;
|
||||
* }
|
||||
*/
|
||||
class OpenID extends OpenIDAdapter
|
||||
class OpenID extends Adapter\OpenID
|
||||
{
|
||||
}
|
||||
|
@@ -7,13 +7,13 @@
|
||||
|
||||
namespace Hybridauth\Provider;
|
||||
|
||||
use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
use Hybridauth\Adapter\OpenID;
|
||||
use Hybridauth\HttpClient;
|
||||
|
||||
/**
|
||||
* PayPal OpenID provider adapter.
|
||||
*/
|
||||
class PaypalOpenID extends OpenIDAdapter
|
||||
class PaypalOpenID extends OpenID
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@@ -7,12 +7,12 @@
|
||||
|
||||
namespace Hybridauth\Provider;
|
||||
|
||||
use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
use Hybridauth\Adapter\OpenID;
|
||||
|
||||
/**
|
||||
* StackExchange OpenID provider adapter.
|
||||
*/
|
||||
class StackExchangeOpenID extends OpenIDAdapter
|
||||
class StackExchangeOpenID extends OpenID
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Hybridauth\Provider;
|
||||
|
||||
use Hybridauth\Adapter\OpenID as OpenIDAdapter;
|
||||
use Hybridauth\Adapter\OpenID;
|
||||
use Hybridauth\Exception\UnexpectedApiResponseException;
|
||||
use Hybridauth\Data;
|
||||
use Hybridauth\User;
|
||||
@@ -32,7 +32,7 @@ use Hybridauth\User;
|
||||
* echo $e->getMessage() ;
|
||||
* }
|
||||
*/
|
||||
class Steam extends OpenIDAdapter
|
||||
class Steam extends OpenID
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@@ -16,7 +16,8 @@ class OAuthConsumer
|
||||
{
|
||||
public $key;
|
||||
public $secret;
|
||||
|
||||
public $callback_url;
|
||||
|
||||
/**
|
||||
* OAuthConsumer constructor.
|
||||
*
|
||||
|
@@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg
|
||||
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
||||
|
||||
```json
|
||||
"phpmailer/phpmailer": "^6.8.1"
|
||||
"phpmailer/phpmailer": "^6.9.1"
|
||||
```
|
||||
|
||||
or run
|
||||
@@ -58,7 +58,8 @@ composer require phpmailer/phpmailer
|
||||
|
||||
Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.
|
||||
|
||||
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`.
|
||||
If you want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at
|
||||
by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services.
|
||||
|
||||
Alternatively, if you're not using Composer, you
|
||||
can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
|
||||
|
@@ -1 +1 @@
|
||||
6.8.1
|
||||
6.9.1
|
||||
|
@@ -47,6 +47,7 @@
|
||||
"yoast/phpunit-polyfills": "^1.0.4"
|
||||
},
|
||||
"suggest": {
|
||||
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
|
||||
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
|
||||
|
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slå mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';
|
||||
|
@@ -6,21 +6,28 @@
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Twoja wersja PHP zawiera błąd, który może powodować uszkodzenie wiadomości. Aby go naprawić, przełącz się na wysyłanie za pomocą SMTP, wyłącz opcję mail.add_x_header w php.ini, przełącz się na MacOS lub Linux lub zaktualizuj PHP do wersji 7.0.17+ lub 7.1.3+.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Następujący adres nadawcy jest nieprawidłowy lub nie istnieje: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . 'następujący adres odbiorcy jest nieprawidłowy lub nie istnieje: ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Nieprawidłowa nazwa lub wartość nagłówka';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Nieprawidłowy wpis hosta: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Nieprawidłowy host: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email odbiorcy.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi lub nie istnieją: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'Kod SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatkowe informacje SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Wywołanie funkcji SMTP Connect() zostało zakończone niepowodzeniem.';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Szczegóły: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
|
||||
|
@@ -357,6 +357,13 @@ class PHPMailer
|
||||
*/
|
||||
public $AuthType = '';
|
||||
|
||||
/**
|
||||
* SMTP SMTPXClient command attibutes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $SMTPXClient = [];
|
||||
|
||||
/**
|
||||
* An implementation of the PHPMailer OAuthTokenProvider interface.
|
||||
*
|
||||
@@ -750,7 +757,7 @@ class PHPMailer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.8.1';
|
||||
const VERSION = '6.9.1';
|
||||
|
||||
/**
|
||||
* Error severity: message only, continue processing.
|
||||
@@ -1571,6 +1578,10 @@ class PHPMailer
|
||||
|
||||
//Validate From, Sender, and ConfirmReadingTo addresses
|
||||
foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) {
|
||||
if ($this->{$address_kind} === null) {
|
||||
$this->{$address_kind} = '';
|
||||
continue;
|
||||
}
|
||||
$this->{$address_kind} = trim($this->{$address_kind});
|
||||
if (empty($this->{$address_kind})) {
|
||||
continue;
|
||||
@@ -1997,6 +2008,38 @@ class PHPMailer
|
||||
return $this->smtp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide SMTP XCLIENT attributes
|
||||
*
|
||||
* @param string $name Attribute name
|
||||
* @param ?string $value Attribute value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setSMTPXclientAttribute($name, $value)
|
||||
{
|
||||
if (!in_array($name, SMTP::$xclient_allowed_attributes)) {
|
||||
return false;
|
||||
}
|
||||
if (isset($this->SMTPXClient[$name]) && $value === null) {
|
||||
unset($this->SMTPXClient[$name]);
|
||||
} elseif ($value !== null) {
|
||||
$this->SMTPXClient[$name] = $value;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SMTP XCLIENT attributes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSMTPXclientAttributes()
|
||||
{
|
||||
return $this->SMTPXClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mail via SMTP.
|
||||
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
|
||||
@@ -2025,6 +2068,9 @@ class PHPMailer
|
||||
} else {
|
||||
$smtp_from = $this->Sender;
|
||||
}
|
||||
if (count($this->SMTPXClient)) {
|
||||
$this->smtp->xclient($this->SMTPXClient);
|
||||
}
|
||||
if (!$this->smtp->mail($smtp_from)) {
|
||||
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
|
||||
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
|
||||
@@ -2187,10 +2233,17 @@ class PHPMailer
|
||||
$this->smtp->hello($hello);
|
||||
//Automatically enable TLS encryption if:
|
||||
//* it's not disabled
|
||||
//* we are not connecting to localhost
|
||||
//* we have openssl extension
|
||||
//* we are not already using SSL
|
||||
//* the server offers STARTTLS
|
||||
if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) {
|
||||
if (
|
||||
$this->SMTPAutoTLS &&
|
||||
$this->Host !== 'localhost' &&
|
||||
$sslext &&
|
||||
$secure !== 'ssl' &&
|
||||
$this->smtp->getServerExt('STARTTLS')
|
||||
) {
|
||||
$tls = true;
|
||||
}
|
||||
if ($tls) {
|
||||
@@ -4047,6 +4100,79 @@ class PHPMailer
|
||||
$this->CustomHeader = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear a specific custom header by name or name and value.
|
||||
* $name value can be overloaded to contain
|
||||
* both header name and value (name:value).
|
||||
*
|
||||
* @param string $name Custom header name
|
||||
* @param string|null $value Header value
|
||||
*
|
||||
* @return bool True if a header was replaced successfully
|
||||
*/
|
||||
public function clearCustomHeader($name, $value = null)
|
||||
{
|
||||
if (null === $value && strpos($name, ':') !== false) {
|
||||
//Value passed in as name:value
|
||||
list($name, $value) = explode(':', $name, 2);
|
||||
}
|
||||
$name = trim($name);
|
||||
$value = (null === $value) ? null : trim($value);
|
||||
|
||||
foreach ($this->CustomHeader as $k => $pair) {
|
||||
if ($pair[0] == $name) {
|
||||
// We remove the header if the value is not provided or it matches.
|
||||
if (null === $value || $pair[1] == $value) {
|
||||
unset($this->CustomHeader[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a custom header.
|
||||
* $name value can be overloaded to contain
|
||||
* both header name and value (name:value).
|
||||
*
|
||||
* @param string $name Custom header name
|
||||
* @param string|null $value Header value
|
||||
*
|
||||
* @return bool True if a header was replaced successfully
|
||||
* @throws Exception
|
||||
*/
|
||||
public function replaceCustomHeader($name, $value = null)
|
||||
{
|
||||
if (null === $value && strpos($name, ':') !== false) {
|
||||
//Value passed in as name:value
|
||||
list($name, $value) = explode(':', $name, 2);
|
||||
}
|
||||
$name = trim($name);
|
||||
$value = (null === $value) ? '' : trim($value);
|
||||
|
||||
$replaced = false;
|
||||
foreach ($this->CustomHeader as $k => $pair) {
|
||||
if ($pair[0] == $name) {
|
||||
if ($replaced) {
|
||||
unset($this->CustomHeader[$k]);
|
||||
continue;
|
||||
}
|
||||
if (strpbrk($name . $value, "\r\n") !== false) {
|
||||
if ($this->exceptions) {
|
||||
throw new Exception($this->lang('invalid_header'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->CustomHeader[$k] = [$name, $value];
|
||||
$replaced = true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an error message to the error container.
|
||||
*
|
||||
|
@@ -46,7 +46,7 @@ class POP3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.8.1';
|
||||
const VERSION = '6.9.1';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
|
@@ -35,7 +35,7 @@ class SMTP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.8.1';
|
||||
const VERSION = '6.9.1';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@@ -198,6 +198,18 @@ class SMTP
|
||||
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
||||
];
|
||||
|
||||
/**
|
||||
* Allowed SMTP XCLIENT attributes.
|
||||
* Must be allowed by the SMTP server. EHLO response is not checked.
|
||||
*
|
||||
* @see https://www.postfix.org/XCLIENT_README.html
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $xclient_allowed_attributes = [
|
||||
'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT'
|
||||
];
|
||||
|
||||
/**
|
||||
* The last transaction ID issued in response to a DATA command,
|
||||
* if one was detected.
|
||||
@@ -971,6 +983,25 @@ class SMTP
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send SMTP XCLIENT command to server and check its return code.
|
||||
*
|
||||
* @return bool True on success
|
||||
*/
|
||||
public function xclient(array $vars)
|
||||
{
|
||||
$xclient_options = "";
|
||||
foreach ($vars as $key => $value) {
|
||||
if (in_array($key, SMTP::$xclient_allowed_attributes)) {
|
||||
$xclient_options .= " {$key}={$value}";
|
||||
}
|
||||
}
|
||||
if (!$xclient_options) {
|
||||
return true;
|
||||
}
|
||||
return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an SMTP RSET command.
|
||||
* Abort any transaction that is currently in progress.
|
||||
|
Reference in New Issue
Block a user