1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 05:07:27 +02:00

HybridAuth updated to v3.11.0. PHPMailer updated to v6.9.1.

This commit is contained in:
camer0n
2024-03-02 14:01:46 -08:00
parent a27b9de560
commit a0581bea20
19 changed files with 218 additions and 46 deletions

View File

@@ -110,17 +110,17 @@
}, },
{ {
"name": "hybridauth/hybridauth", "name": "hybridauth/hybridauth",
"version": "v3.10.0", "version": "v3.11.0",
"version_normalized": "3.10.0.0", "version_normalized": "3.11.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/hybridauth/hybridauth.git", "url": "https://github.com/hybridauth/hybridauth.git",
"reference": "9b5e8a7782b630d5b1151003999d6db91a863ffe" "reference": "b70b9cbe1c7fa99b5847c5868610a8f024cc7d38"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/9b5e8a7782b630d5b1151003999d6db91a863ffe", "url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/b70b9cbe1c7fa99b5847c5868610a8f024cc7d38",
"reference": "9b5e8a7782b630d5b1151003999d6db91a863ffe", "reference": "b70b9cbe1c7fa99b5847c5868610a8f024cc7d38",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -134,7 +134,7 @@
"firebase/php-jwt": "Needed to support Apple provider", "firebase/php-jwt": "Needed to support Apple provider",
"phpseclib/phpseclib": "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", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@@ -169,7 +169,7 @@
"support": { "support": {
"gitter": "https://gitter.im/hybridauth/hybridauth", "gitter": "https://gitter.im/hybridauth/hybridauth",
"issues": "https://github.com/hybridauth/hybridauth/issues", "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" "install-path": "../hybridauth/hybridauth"
}, },
@@ -454,17 +454,17 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.8.1", "version": "v6.9.1",
"version_normalized": "6.8.1.0", "version_normalized": "6.9.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016" "reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016", "reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -484,6 +484,7 @@
"yoast/phpunit-polyfills": "^1.0.4" "yoast/phpunit-polyfills": "^1.0.4"
}, },
"suggest": { "suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing", "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "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)", "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" "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", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@@ -525,7 +526,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": { "support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues", "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": [ "funding": [
{ {

View File

@@ -3,7 +3,7 @@
'name' => 'e107inc/e107', 'name' => 'e107inc/e107',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '34ba78023cb1fe91319bef6dc47592105cdff8f4', 'reference' => 'a27b9de56056e1a7c508980cd6c47a96cb877e09',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../../', 'install_path' => __DIR__ . '/../../../',
'aliases' => array(), 'aliases' => array(),
@@ -13,7 +13,7 @@
'e107inc/e107' => array( 'e107inc/e107' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '34ba78023cb1fe91319bef6dc47592105cdff8f4', 'reference' => 'a27b9de56056e1a7c508980cd6c47a96cb877e09',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../../', 'install_path' => __DIR__ . '/../../../',
'aliases' => array(), 'aliases' => array(),
@@ -29,9 +29,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'hybridauth/hybridauth' => array( 'hybridauth/hybridauth' => array(
'pretty_version' => 'v3.10.0', 'pretty_version' => 'v3.11.0',
'version' => '3.10.0.0', 'version' => '3.11.0.0',
'reference' => '9b5e8a7782b630d5b1151003999d6db91a863ffe', 'reference' => 'b70b9cbe1c7fa99b5847c5868610a8f024cc7d38',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../hybridauth/hybridauth', 'install_path' => __DIR__ . '/../hybridauth/hybridauth',
'aliases' => array(), 'aliases' => array(),
@@ -74,9 +74,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'phpmailer/phpmailer' => array( 'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.8.1', 'pretty_version' => 'v6.9.1',
'version' => '6.8.1.0', 'version' => '6.9.1.0',
'reference' => 'e88da8d679acc3824ff231fdc553565b802ac016', 'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(), 'aliases' => array(),

View File

@@ -3,7 +3,7 @@
[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/) [![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/)
## [Hybridauth](https://hybridauth.github.io/) 3.10 ## [Hybridauth](https://hybridauth.github.io/) 3.11
[![Build Status](https://travis-ci.org/hybridauth/hybridauth.svg?branch=master)](https://travis-ci.org/hybridauth/hybridauth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hybridauth/hybridauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [![Latest Stable Version](https://poser.pugx.org/hybridauth/hybridauth/v/stable.png)](https://packagist.org/packages/hybridauth/hybridauth) [![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/hybridauth/hybridauth.svg?branch=master)](https://travis-ci.org/hybridauth/hybridauth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hybridauth/hybridauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [![Latest Stable Version](https://poser.pugx.org/hybridauth/hybridauth/v/stable.png)](https://packagist.org/packages/hybridauth/hybridauth) [![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

View File

@@ -425,8 +425,9 @@ abstract class OAuth2 extends AbstractAdapter implements AdapterInterface
* http://tools.ietf.org/html/rfc6749#section-4.1.1 * http://tools.ietf.org/html/rfc6749#section-4.1.1
*/ */
if ($this->supportRequestState if ($this->supportRequestState
&& $this->getStoredData('authorization_state') != $state && (!$state || $this->getStoredData('authorization_state') != $state)
) { ) {
$this->deleteStoredData('authorization_state');
throw new InvalidAuthorizationStateException( throw new InvalidAuthorizationStateException(
'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] ' 'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] '
. 'of this page is either invalid or has already been consumed.' . 'of this page is either invalid or has already been consumed.'

View File

@@ -7,12 +7,12 @@
namespace Hybridauth\Provider; namespace Hybridauth\Provider;
use Hybridauth\Adapter\OpenID as OpenIDAdapter; use Hybridauth\Adapter\OpenID;
/** /**
* AOL OpenID provider adapter. * AOL OpenID provider adapter.
*/ */
class AOLOpenID extends OpenIDAdapter class AOLOpenID extends OpenID
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@@ -244,11 +244,13 @@ class Apple extends OAuth2
$user = new Data\Collection($objUser); $user = new Data\Collection($objUser);
if (!$user->isEmpty()) { if (!$user->isEmpty()) {
$name = $user->get('name'); $name = $user->get('name');
if (!empty($name->firstName)) {
$userProfile->firstName = $name->firstName; $userProfile->firstName = $name->firstName;
$userProfile->lastName = $name->lastName; $userProfile->lastName = $name->lastName;
$userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]); $userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]);
} }
} }
}
return $userProfile; return $userProfile;
} }

View File

@@ -7,7 +7,7 @@
namespace Hybridauth\Provider; namespace Hybridauth\Provider;
use Hybridauth\Adapter\OpenID as OpenIDAdapter; use Hybridauth\Adapter;
/** /**
* Generic OpenID providers adapter. * Generic OpenID providers adapter.
@@ -39,6 +39,6 @@ use Hybridauth\Adapter\OpenID as OpenIDAdapter;
* echo $e->getMessage() ; * echo $e->getMessage() ;
* } * }
*/ */
class OpenID extends OpenIDAdapter class OpenID extends Adapter\OpenID
{ {
} }

View File

@@ -7,13 +7,13 @@
namespace Hybridauth\Provider; namespace Hybridauth\Provider;
use Hybridauth\Adapter\OpenID as OpenIDAdapter; use Hybridauth\Adapter\OpenID;
use Hybridauth\HttpClient; use Hybridauth\HttpClient;
/** /**
* PayPal OpenID provider adapter. * PayPal OpenID provider adapter.
*/ */
class PaypalOpenID extends OpenIDAdapter class PaypalOpenID extends OpenID
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@@ -7,12 +7,12 @@
namespace Hybridauth\Provider; namespace Hybridauth\Provider;
use Hybridauth\Adapter\OpenID as OpenIDAdapter; use Hybridauth\Adapter\OpenID;
/** /**
* StackExchange OpenID provider adapter. * StackExchange OpenID provider adapter.
*/ */
class StackExchangeOpenID extends OpenIDAdapter class StackExchangeOpenID extends OpenID
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@@ -7,7 +7,7 @@
namespace Hybridauth\Provider; namespace Hybridauth\Provider;
use Hybridauth\Adapter\OpenID as OpenIDAdapter; use Hybridauth\Adapter\OpenID;
use Hybridauth\Exception\UnexpectedApiResponseException; use Hybridauth\Exception\UnexpectedApiResponseException;
use Hybridauth\Data; use Hybridauth\Data;
use Hybridauth\User; use Hybridauth\User;
@@ -32,7 +32,7 @@ use Hybridauth\User;
* echo $e->getMessage() ; * echo $e->getMessage() ;
* } * }
*/ */
class Steam extends OpenIDAdapter class Steam extends OpenID
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@@ -16,6 +16,7 @@ class OAuthConsumer
{ {
public $key; public $key;
public $secret; public $secret;
public $callback_url;
/** /**
* OAuthConsumer constructor. * OAuthConsumer constructor.

View File

@@ -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: 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 ```json
"phpmailer/phpmailer": "^6.8.1" "phpmailer/phpmailer": "^6.9.1"
``` ```
or run 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. 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 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: 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:

View File

@@ -1 +1 @@
6.8.1 6.9.1

View File

@@ -47,6 +47,7 @@
"yoast/phpunit-polyfills": "^1.0.4" "yoast/phpunit-polyfills": "^1.0.4"
}, },
"suggest": { "suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing", "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",

View File

@@ -9,6 +9,7 @@
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; $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['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';

View File

@@ -6,21 +6,28 @@
*/ */
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.'; $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['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['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
$PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.'; $PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.';
$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: '; $PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: ';
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: '; $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_access'] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć 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['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['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_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['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['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['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['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_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['smtp_error'] = 'Błąd SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: '; $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';

View File

@@ -357,6 +357,13 @@ class PHPMailer
*/ */
public $AuthType = ''; public $AuthType = '';
/**
* SMTP SMTPXClient command attibutes
*
* @var array
*/
protected $SMTPXClient = [];
/** /**
* An implementation of the PHPMailer OAuthTokenProvider interface. * An implementation of the PHPMailer OAuthTokenProvider interface.
* *
@@ -750,7 +757,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.8.1'; const VERSION = '6.9.1';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@@ -1571,6 +1578,10 @@ class PHPMailer
//Validate From, Sender, and ConfirmReadingTo addresses //Validate From, Sender, and ConfirmReadingTo addresses
foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) {
if ($this->{$address_kind} === null) {
$this->{$address_kind} = '';
continue;
}
$this->{$address_kind} = trim($this->{$address_kind}); $this->{$address_kind} = trim($this->{$address_kind});
if (empty($this->{$address_kind})) { if (empty($this->{$address_kind})) {
continue; continue;
@@ -1997,6 +2008,38 @@ class PHPMailer
return $this->smtp; 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. * Send mail via SMTP.
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
@@ -2025,6 +2068,9 @@ class PHPMailer
} else { } else {
$smtp_from = $this->Sender; $smtp_from = $this->Sender;
} }
if (count($this->SMTPXClient)) {
$this->smtp->xclient($this->SMTPXClient);
}
if (!$this->smtp->mail($smtp_from)) { if (!$this->smtp->mail($smtp_from)) {
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
@@ -2187,10 +2233,17 @@ class PHPMailer
$this->smtp->hello($hello); $this->smtp->hello($hello);
//Automatically enable TLS encryption if: //Automatically enable TLS encryption if:
//* it's not disabled //* it's not disabled
//* we are not connecting to localhost
//* we have openssl extension //* we have openssl extension
//* we are not already using SSL //* we are not already using SSL
//* the server offers STARTTLS //* 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; $tls = true;
} }
if ($tls) { if ($tls) {
@@ -4047,6 +4100,79 @@ class PHPMailer
$this->CustomHeader = []; $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. * Add an error message to the error container.
* *

View File

@@ -46,7 +46,7 @@ class POP3
* *
* @var string * @var string
*/ */
const VERSION = '6.8.1'; const VERSION = '6.9.1';
/** /**
* Default POP3 port number. * Default POP3 port number.

View File

@@ -35,7 +35,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.8.1'; const VERSION = '6.9.1';
/** /**
* SMTP line break constant. * SMTP line break constant.
@@ -198,6 +198,18 @@ class SMTP
'Mailjet' => '/[\d]{3} OK queued as (.*)/', '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, * The last transaction ID issued in response to a DATA command,
* if one was detected. * 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. * Send an SMTP RSET command.
* Abort any transaction that is currently in progress. * Abort any transaction that is currently in progress.