deps update

This commit is contained in:
Rodolfo Berrios 2021-07-12 11:13:15 -04:00
parent 97313065cf
commit 1b59578209
No known key found for this signature in database
GPG key ID: A5329E17FAA2FA7A
76 changed files with 1186 additions and 1514 deletions

View file

@ -42,6 +42,8 @@ namespace Composer\Autoload;
*/ */
class ClassLoader class ClassLoader
{ {
private $vendorDir;
// PSR-4 // PSR-4
private $prefixLengthsPsr4 = array(); private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array(); private $prefixDirsPsr4 = array();
@ -57,6 +59,13 @@ class ClassLoader
private $missingClasses = array(); private $missingClasses = array();
private $apcuPrefix; private $apcuPrefix;
private static $registeredLoaders = array();
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
public function getPrefixes() public function getPrefixes()
{ {
if (!empty($this->prefixesPsr0)) { if (!empty($this->prefixesPsr0)) {
@ -300,6 +309,17 @@ class ClassLoader
public function register($prepend = false) public function register($prepend = false)
{ {
spl_autoload_register(array($this, 'loadClass'), true, $prepend); spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
} }
/** /**
@ -308,13 +328,17 @@ class ClassLoader
public function unregister() public function unregister()
{ {
spl_autoload_unregister(array($this, 'loadClass')); spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
} }
/** /**
* Loads the given class or interface. * Loads the given class or interface.
* *
* @param string $class The name of the class * @param string $class The name of the class
* @return bool|null True if loaded, null otherwise * @return true|null True if loaded, null otherwise
*/ */
public function loadClass($class) public function loadClass($class)
{ {
@ -323,6 +347,8 @@ class ClassLoader
return true; return true;
} }
return null;
} }
/** /**
@ -367,6 +393,16 @@ class ClassLoader
return $file; return $file;
} }
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
private function findFileWithExtension($class, $ext) private function findFileWithExtension($class, $ext)
{ {
// PSR-4 lookup // PSR-4 lookup

View file

@ -1,7 +1,18 @@
<?php <?php
namespace Composer; namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
@ -9,6 +20,8 @@ use Composer\Semver\VersionParser;
class InstalledVersions class InstalledVersions
{ {
private static $installed = array ( private static $installed = array (
@ -19,8 +32,9 @@ private static $installed = array (
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'ecf6a7c2d21c3d75fe3aab960bfa00e0e508877f', 'reference' => '97313065cf44842b1d7f0ae719c549d917749ae4',
'name' => 'chevereto/chevereto-free', 'name' => 'chevereto/chevereto-free',
'dev' => true,
), ),
'versions' => 'versions' =>
array ( array (
@ -31,7 +45,8 @@ private static $installed = array (
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'ecf6a7c2d21c3d75fe3aab960bfa00e0e508877f', 'reference' => '97313065cf44842b1d7f0ae719c549d917749ae4',
'dev-requirement' => false,
), ),
'jbroadway/urlify' => 'jbroadway/urlify' =>
array ( array (
@ -41,24 +56,27 @@ private static $installed = array (
array ( array (
), ),
'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300', 'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300',
'dev-requirement' => false,
), ),
'mobiledetect/mobiledetectlib' => 'mobiledetect/mobiledetectlib' =>
array ( array (
'pretty_version' => '2.8.34', 'pretty_version' => '2.8.37',
'version' => '2.8.34.0', 'version' => '2.8.37.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '6f8113f57a508494ca36acbcfa2dc2d923c7ed5b', 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7',
'dev-requirement' => false,
), ),
'phpmailer/phpmailer' => 'phpmailer/phpmailer' =>
array ( array (
'pretty_version' => 'v6.1.8', 'pretty_version' => 'v6.5.0',
'version' => '6.1.8.0', 'version' => '6.5.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '917ab212fa00dc6eacbb26e8bc387ebe40993bc1', 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
'dev-requirement' => false,
), ),
'tijsverkoyen/akismet' => 'tijsverkoyen/akismet' =>
array ( array (
@ -68,9 +86,12 @@ private static $installed = array (
array ( array (
), ),
'reference' => '6f7987fe181fd0fddbc9832f2ddeaf088425c83f', 'reference' => '6f7987fe181fd0fddbc9832f2ddeaf088425c83f',
'dev-requirement' => false,
), ),
), ),
); );
private static $canGetVendors;
private static $installedByVendor = array();
@ -80,7 +101,16 @@ private static $installed = array (
public static function getInstalledPackages() public static function getInstalledPackages()
{ {
return array_keys(self::$installed['versions']); $packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
} }
@ -91,11 +121,17 @@ return array_keys(self::$installed['versions']);
public static function isInstalled($packageName)
public static function isInstalled($packageName, $includeDevRequirements = true)
{ {
return isset(self::$installed['versions'][$packageName]); foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev-requirement']);
}
} }
return false;
}
@ -128,42 +164,50 @@ return $provided->matches($constraint);
public static function getVersionRanges($packageName) public static function getVersionRanges($packageName)
{ {
if (!isset(self::$installed['versions'][$packageName])) { foreach (self::getInstalled() as $installed) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); if (!isset($installed['versions'][$packageName])) {
continue;
} }
$ranges = array(); $ranges = array();
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) { if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = self::$installed['versions'][$packageName]['pretty_version']; $ranges[] = $installed['versions'][$packageName]['pretty_version'];
} }
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) { if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']); $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
} }
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) { if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']); $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
} }
if (array_key_exists('provided', self::$installed['versions'][$packageName])) { if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']); $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
} }
return implode(' || ', $ranges); return implode(' || ', $ranges);
} }
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getVersion($packageName) public static function getVersion($packageName)
{ {
if (!isset(self::$installed['versions'][$packageName])) { foreach (self::getInstalled() as $installed) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); if (!isset($installed['versions'][$packageName])) {
continue;
} }
if (!isset(self::$installed['versions'][$packageName]['version'])) { if (!isset($installed['versions'][$packageName]['version'])) {
return null; return null;
} }
return self::$installed['versions'][$packageName]['version']; return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
} }
@ -172,15 +216,19 @@ return self::$installed['versions'][$packageName]['version'];
public static function getPrettyVersion($packageName) public static function getPrettyVersion($packageName)
{ {
if (!isset(self::$installed['versions'][$packageName])) { foreach (self::getInstalled() as $installed) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); if (!isset($installed['versions'][$packageName])) {
continue;
} }
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) { if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null; return null;
} }
return self::$installed['versions'][$packageName]['pretty_version']; return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
} }
@ -189,15 +237,19 @@ return self::$installed['versions'][$packageName]['pretty_version'];
public static function getReference($packageName) public static function getReference($packageName)
{ {
if (!isset(self::$installed['versions'][$packageName])) { foreach (self::getInstalled() as $installed) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); if (!isset($installed['versions'][$packageName])) {
continue;
} }
if (!isset(self::$installed['versions'][$packageName]['reference'])) { if (!isset($installed['versions'][$packageName]['reference'])) {
return null; return null;
} }
return self::$installed['versions'][$packageName]['reference']; return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
} }
@ -206,7 +258,9 @@ return self::$installed['versions'][$packageName]['reference'];
public static function getRootPackage() public static function getRootPackage()
{ {
return self::$installed['root']; $installed = self::getInstalled();
return $installed[0]['root'];
} }
@ -241,5 +295,33 @@ return self::$installed;
public static function reload($data) public static function reload($data)
{ {
self::$installed = $data; self::$installed = $data;
self::$installedByVendor = array();
}
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
}
}
}
$installed[] = self::$installed;
return $installed;
} }
} }

View file

@ -22,10 +22,8 @@ class ComposerAutoloaderInit5ebab6dc32ca006b1a67a63e20c04846
return self::$loader; return self::$loader;
} }
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit5ebab6dc32ca006b1a67a63e20c04846', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit5ebab6dc32ca006b1a67a63e20c04846', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit5ebab6dc32ca006b1a67a63e20c04846', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit5ebab6dc32ca006b1a67a63e20c04846', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());

View file

@ -62,17 +62,17 @@
}, },
{ {
"name": "mobiledetect/mobiledetectlib", "name": "mobiledetect/mobiledetectlib",
"version": "2.8.34", "version": "2.8.37",
"version_normalized": "2.8.34.0", "version_normalized": "2.8.37.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/serbanghita/Mobile-Detect.git", "url": "https://github.com/serbanghita/Mobile-Detect.git",
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b" "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/9841e3c46f5bd0739b53aed8ac677fa712943df7",
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -81,7 +81,7 @@
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.8.35||~5.7" "phpunit/phpunit": "~4.8.35||~5.7"
}, },
"time": "2019-09-18T18:44:20+00:00", "time": "2021-02-19T21:22:57+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -113,21 +113,31 @@
"mobile detector", "mobile detector",
"php mobile detect" "php mobile detect"
], ],
"support": {
"issues": "https://github.com/serbanghita/Mobile-Detect/issues",
"source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.37"
},
"funding": [
{
"url": "https://github.com/serbanghita",
"type": "github"
}
],
"install-path": "../mobiledetect/mobiledetectlib" "install-path": "../mobiledetect/mobiledetectlib"
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.1.8", "version": "v6.5.0",
"version_normalized": "6.1.8.0", "version_normalized": "6.5.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1" "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/917ab212fa00dc6eacbb26e8bc387ebe40993bc1", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1", "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -137,19 +147,22 @@
"php": ">=5.5.0" "php": ">=5.5.0"
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2", "doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2", "phpcompatibility/php-compatibility": "^9.3.5",
"phpunit/phpunit": "^4.8 || ^5.7" "roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5.6",
"yoast/phpunit-polyfills": "^0.2.0"
}, },
"suggest": { "suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging", "psr/log": "For optional PSR-3 debug logging",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"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)"
}, },
"time": "2020-10-09T14:55:58+00:00", "time": "2021-06-16T14:33:43+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -181,11 +194,11 @@
"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.1.8" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0"
}, },
"funding": [ "funding": [
{ {
"url": "https://github.com/synchro", "url": "https://github.com/Synchro",
"type": "github" "type": "github"
} }
], ],
@ -234,5 +247,6 @@
"install-path": "../tijsverkoyen/akismet" "install-path": "../tijsverkoyen/akismet"
} }
], ],
"dev": true "dev": true,
"dev-package-names": []
} }

View file

@ -6,8 +6,9 @@
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'ecf6a7c2d21c3d75fe3aab960bfa00e0e508877f', 'reference' => '97313065cf44842b1d7f0ae719c549d917749ae4',
'name' => 'chevereto/chevereto-free', 'name' => 'chevereto/chevereto-free',
'dev' => true,
), ),
'versions' => 'versions' =>
array ( array (
@ -18,7 +19,8 @@
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'ecf6a7c2d21c3d75fe3aab960bfa00e0e508877f', 'reference' => '97313065cf44842b1d7f0ae719c549d917749ae4',
'dev-requirement' => false,
), ),
'jbroadway/urlify' => 'jbroadway/urlify' =>
array ( array (
@ -28,24 +30,27 @@
array ( array (
), ),
'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300', 'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300',
'dev-requirement' => false,
), ),
'mobiledetect/mobiledetectlib' => 'mobiledetect/mobiledetectlib' =>
array ( array (
'pretty_version' => '2.8.34', 'pretty_version' => '2.8.37',
'version' => '2.8.34.0', 'version' => '2.8.37.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '6f8113f57a508494ca36acbcfa2dc2d923c7ed5b', 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7',
'dev-requirement' => false,
), ),
'phpmailer/phpmailer' => 'phpmailer/phpmailer' =>
array ( array (
'pretty_version' => 'v6.1.8', 'pretty_version' => 'v6.5.0',
'version' => '6.1.8.0', 'version' => '6.5.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '917ab212fa00dc6eacbb26e8bc387ebe40993bc1', 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
'dev-requirement' => false,
), ),
'tijsverkoyen/akismet' => 'tijsverkoyen/akismet' =>
array ( array (
@ -55,6 +60,7 @@
array ( array (
), ),
'reference' => '6f7987fe181fd0fddbc9832f2ddeaf088425c83f', 'reference' => '6f7987fe181fd0fddbc9832f2ddeaf088425c83f',
'dev-requirement' => false,
), ),
), ),
); );

View file

@ -1,24 +0,0 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 50500)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.';
}
$missingExtensions = array();
extension_loaded('ctype') || $missingExtensions[] = 'ctype';
extension_loaded('curl') || $missingExtensions[] = 'curl';
extension_loaded('filter') || $missingExtensions[] = 'filter';
extension_loaded('hash') || $missingExtensions[] = 'hash';
if ($missingExtensions) {
$issues[] = 'Your Composer dependencies require the following PHP extensions to be installed: ' . implode(', ', $missingExtensions);
}
if ($issues) {
echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues);
exit(104);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
> Motto: "Every business should have a detection script to detect mobile readers." > Motto: "Every business should have a detection script to detect mobile readers."
[![Build Status](https://travis-ci.org/serbanghita/Mobile-Detect.svg?branch=devel)](https://travis-ci.org/serbanghita/Mobile-Detect) ![Build status](https://github.com/serbanghita/Mobile-Detect/workflows/Mobile-Detect/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/mobiledetect/mobiledetectlib/v/stable.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) [![Latest Stable Version](https://poser.pugx.org/mobiledetect/mobiledetectlib/v/stable.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
[![Total Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/downloads.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) [![Total Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/downloads.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
[![Daily Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/d/daily.png)](https://packagist.org/packages/mobiledetect/mobiledetectlib) [![Daily Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/d/daily.png)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
@ -68,7 +68,7 @@ or include the dependency in the `composer.json` file:
#### Demo #### Demo
* [:iphone: Live demo!](http://demo.mobiledetect.net) * [:iphone: Live demo!](https://demo.mobiledetect.net)
* [Code examples](../../wiki/Code-examples) * [Code examples](../../wiki/Code-examples)
#### Contribute #### Contribute

View file

@ -1,983 +0,0 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "4a5fd4cd7cc7247a6df7411b031d4845",
"packages": [],
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-06-14T21:17:01+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.5",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b",
"reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2016-01-25T08:17:30+00:00"
},
{
"name": "phpspec/prophecy",
"version": "1.7.3",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"sebastian/comparator": "^1.1|^2.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev"
}
},
"autoload": {
"psr-0": {
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2017-11-24T13:59:53+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "~1.3",
"sebastian/environment": "^1.3.2",
"sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
"coverage",
"testing",
"xunit"
],
"time": "2015-10-06T15:47:00+00:00"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.4.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2017-11-27T13:52:08+00:00"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Simple template engine.",
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [
"template"
],
"time": "2015-06-21T13:50:34+00:00"
},
{
"name": "phpunit/php-timer",
"version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Utility class for timing",
"homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
"time": "2017-02-26T11:10:40+00:00"
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.12",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
"time": "2017-12-04T08:55:13+00:00"
},
{
"name": "phpunit/phpunit",
"version": "4.8.36",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
"reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpspec/prophecy": "^1.3.1",
"phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.2.2",
"sebastian/diff": "~1.2",
"sebastian/environment": "~1.3",
"sebastian/exporter": "~1.2",
"sebastian/global-state": "~1.0",
"sebastian/version": "~1.0",
"symfony/yaml": "~2.1|~3.0"
},
"suggest": {
"phpunit/php-invoker": "~1.1"
},
"bin": [
"phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.8.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "The PHP Unit Testing framework.",
"homepage": "https://phpunit.de/",
"keywords": [
"phpunit",
"testing",
"xunit"
],
"time": "2017-06-21T08:07:12+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "2.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": ">=5.3.3",
"phpunit/php-text-template": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"suggest": {
"ext-soap": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Mock Object library for PHPUnit",
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
"keywords": [
"mock",
"xunit"
],
"time": "2015-10-02T06:51:40+00:00"
},
{
"name": "sebastian/comparator",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2 || ~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2017-01-29T09:50:25+00:00"
},
{
"name": "sebastian/diff",
"version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Diff implementation",
"homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
"time": "2017-05-22T07:24:03+00:00"
},
{
"name": "sebastian/environment",
"version": "1.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
"hhvm"
],
"time": "2016-08-18T05:49:44+00:00"
},
{
"name": "sebastian/exporter",
"version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"ext-mbstring": "*",
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"time": "2016-06-17T09:04:28+00:00"
},
{
"name": "sebastian/global-state",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"suggest": {
"ext-uopz": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Snapshotting of global state",
"homepage": "http://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
"time": "2015-10-12T03:26:01+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2016-10-03T07:41:43+00:00"
},
{
"name": "sebastian/version",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-06-21T13:59:46+00:00"
},
{
"name": "symfony/yaml",
"version": "v2.8.32",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "968ef42161e4bc04200119da473077f9e7015128"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128",
"reference": "968ef42161e4bc04200119da473077f9e7015128",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-11-29T09:33:18+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.0.0"
},
"platform-dev": []
}

View file

@ -1,8 +1,9 @@
**Known limitations** **Known limitations**
* Mobile Detect script was designed to detect `mobile` devices. Implicitly other devices are considered to be `desktop`. * Mobile Detect script was designed to detect `mobile` devices. Implicitly other devices are considered to be `desktop`.
* User-Agent and HTTP headers sniffing is a non reliable method of detecting a mobile device. * User-Agent and HTTP headers sniffing is a non-reliable method of detecting a mobile device.
* If the mobile browser is set on `Desktop mode`, the Mobile Detect script has no way of knowing that the device is `mobile`. * If the mobile browser is set on `Desktop mode`, the Mobile Detect script has no indicator (eg. a group of strings) that would allow it to detect that the device is `mobile`.
* Ipad 2019 is being recognized as a desktop because of Safari's default `Request Desktop Website` setting. See details and possible workaround [#820](https://github.com/serbanghita/Mobile-Detect/issues/820)
* Some touchscreen devices (eg. Microsoft Surface) are tough to detect as mobile since they can be used in a laptop mode. See: [#32](https://github.com/serbanghita/Mobile-Detect/issues/32), [#461](https://github.com/serbanghita/Mobile-Detect/issues/461), [#667](https://github.com/serbanghita/Mobile-Detect/issues/667) * Some touchscreen devices (eg. Microsoft Surface) are tough to detect as mobile since they can be used in a laptop mode. See: [#32](https://github.com/serbanghita/Mobile-Detect/issues/32), [#461](https://github.com/serbanghita/Mobile-Detect/issues/461), [#667](https://github.com/serbanghita/Mobile-Detect/issues/667)
* Some mobile devices (eg. IPadOS, Google Pixel Slate). See: [#795](https://github.com/serbanghita/Mobile-Detect/issues/795), [#788](https://github.com/serbanghita/Mobile-Detect/issues/788) * Some mobile devices (eg. IPadOS, Google Pixel Slate). See: [#795](https://github.com/serbanghita/Mobile-Detect/issues/795), [#788](https://github.com/serbanghita/Mobile-Detect/issues/788)
* Detecting the device brand (eg. Apple, Samsung, HTC) is not 100% reliable. * Detecting the device brand (eg. Apple, Samsung, HTC) is not 100% reliable.
@ -10,3 +11,4 @@
We cannot guarantee that they are using the class properly or if they provide the latest version. We cannot guarantee that they are using the class properly or if they provide the latest version.
* Version `2.x` is made to be PHP 5.3 compatible because of the backward compatibility changes of PHP. * Version `2.x` is made to be PHP 5.3 compatible because of the backward compatibility changes of PHP.
* There are hundreds of devices launched every month, we cannot keep a 100% up to date detection rate. * There are hundreds of devices launched every month, we cannot keep a 100% up to date detection rate.
* The script cannot detect the viewport, pixel density or resolution of the screen since it's running server-side.

View file

@ -1,46 +1,45 @@
![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) ![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png)
# PHPMailer - A full-featured email creation and transfer class for PHP # PHPMailer A full-featured email creation and transfer class for PHP
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) [![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) [![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](http://phpmailer.github.io/PHPMailer/) ## Features
## Class Features
- Probably the world's most popular code for sending email from PHP! - Probably the world's most popular code for sending email from PHP!
- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more - Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
- Integrated SMTP support - send without a local mail server - Integrated SMTP support send without a local mail server
- Send emails with multiple To, CC, BCC and Reply-to addresses - Send emails with multiple To, CC, BCC and Reply-to addresses
- Multipart/alternative emails for mail clients that do not read HTML email - Multipart/alternative emails for mail clients that do not read HTML email
- Add attachments, including inline - Add attachments, including inline
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings - Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SSL and SMTP+STARTTLS transports - SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
- Validates email addresses automatically - Validates email addresses automatically
- Protect against header injection attacks - Protects against header injection attacks
- Error messages in over 50 languages! - Error messages in over 50 languages!
- DKIM and S/MIME signing support - DKIM and S/MIME signing support
- Compatible with PHP 5.5 and later - Compatible with PHP 5.5 and later, including PHP 8.0
- Namespaced to prevent name clashes - Namespaced to prevent name clashes
- Much more! - Much more!
## Why you might need it ## Why you might need it
Many PHP developers need to send email from their code. The only PHP function that supports this is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong! Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
*Please* don't be tempted to do it yourself if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/), [Zend/Mail](https://zendframework.github.io/zend-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc.
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server. The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
*Please* don't be tempted to do it yourself if you don't use PHPMailer, there are many other excellent libraries that
you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/)
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc.
## License ## License
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read LICENSE for information on the software availability and distribution. This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
## Installation & loading ## Installation & loading
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.1" "phpmailer/phpmailer": "^6.2"
``` ```
or run or run
@ -53,7 +52,8 @@ Note that the `vendor` folder and the `vendor/autoload.php` script are generated
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 the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`.
Alternatively, if you're not using Composer, 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: 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:
```php ```php
<?php <?php
@ -65,18 +65,16 @@ require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php'; require 'path/to/PHPMailer/src/SMTP.php';
``` ```
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
If you don't speak git or just want a tarball, click the 'zip' button on the right of the project page in GitHub, though note that docs and examples are not included in the tarball.
## Legacy versions ## Legacy versions
PHPMailer 5.2 (which is compatible with PHP 5.0 - 7.0) is no longer being supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases. PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
### Upgrading from 5.2 ### Upgrading from 5.2
The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details. The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details.
### Minimal installation ### Minimal installation
While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP, you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer! While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
## A Simple Example ## A Simple Example
@ -98,7 +96,7 @@ try {
//Server settings //Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP $mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication $mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'user@example.com'; //SMTP username $mail->Username = 'user@example.com'; //SMTP username
$mail->Password = 'secret'; //SMTP password $mail->Password = 'secret'; //SMTP password
@ -130,7 +128,7 @@ try {
} }
``` ```
You'll find plenty more to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through gmail, building contact forms, sending to mailing lists, and more.
If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance.
@ -144,45 +142,39 @@ PHPMailer defaults to English, but in the [language](https://github.com/PHPMaile
$mail->setLanguage('fr', '/optional/path/to/language/directory/'); $mail->setLanguage('fr', '/optional/path/to/language/directory/');
``` ```
We welcome corrections and new languages - if you're looking for corrections to do, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. We welcome corrections and new languages if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations.
## Documentation ## Documentation
Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated. Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated.
Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps).
Note that in order to reduce PHPMailer's deployed code footprint, the examples are no longer included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly.
Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption. You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
## Tests ## Tests
There is a PHPUnit test script in the [test](https://github.com/PHPMailer/PHPMailer/tree/master/test/) folder. PHPMailer uses PHPUnit 4.8 - we would use 5.x but we need to run on PHP 5.5. [PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) [![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)
If this isn't passing, is there something you can do to help? If this isn't passing, is there something you can do to help?
## Security ## Security
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. Please disclose any vulnerabilities found responsibly report security issues to the maintainers privately.
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security).
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a critical remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for more detail on security issues.
## Contributing ## Contributing
Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).
We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. We're particularly interested in fixing edge-cases, expanding test coverage and updating translations.
If you found a mistake in the docs, or want to add something, go ahead and amend the wiki - anyone can edit it. If you found a mistake in the docs, or want to add something, go ahead and amend the wiki anyone can edit it.
If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone:
@ -193,27 +185,36 @@ git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.
## Sponsorship ## Sponsorship
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system. Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="250" height="28" alt="Smartmessages email marketing"></a> <a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a>
Other contributions are gladly received, whether in beer 🍺, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰. If you'd like to donate to say "thank you" to maintainers or contributors, please contact them through individual profile pages via [the contributors page](https://github.com/PHPMailer/PHPMailer/graphs/contributors). Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme.
## PHPMailer For Enterprise
Available as part of the Tidelift Subscription.
The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial
support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and
improve code health, while paying the maintainers of the exact packages you
use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Changelog ## Changelog
See [changelog](changelog.md). See [changelog](changelog.md).
## History ## History
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). - PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/).
- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004. - [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004.
- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. - Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer) in 2008. - Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. - Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013.
- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. - PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
### What's changed since moving from SourceForge? ### What's changed since moving from SourceForge?
- Official successor to the SourceForge and Google Code projects. - Official successor to the SourceForge and Google Code projects.
- Test suite. - Test suite.
- Continuous integration with Travis-CI. - Continuous integration with Github Actions.
- Composer support. - Composer support.
- Public development. - Public development.
- Additional languages and language strings. - Additional languages and language strings.

View file

@ -1,6 +1,13 @@
# Security notices relating to PHPMailer # Security notices relating to PHPMailer
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.
PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).
PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows.
PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift.
PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.
PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.

View file

@ -1 +1 @@
6.1.8 6.5.0

View file

@ -21,7 +21,7 @@
], ],
"funding": [ "funding": [
{ {
"url": "https://github.com/synchro", "url": "https://github.com/Synchro",
"type": "github" "type": "github"
} }
], ],
@ -32,16 +32,19 @@
"ext-hash": "*" "ext-hash": "*"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.2", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpunit/phpunit": "^4.8 || ^5.7", "doctrine/annotations": "^1.2",
"doctrine/annotations": "^1.2" "phpcompatibility/php-compatibility": "^9.3.5",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5.6",
"yoast/phpunit-polyfills": "^0.2.0"
}, },
"suggest": { "suggest": {
"psr/log": "For optional PSR-3 debug logging", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset",
"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)"
}, },
"autoload": { "autoload": {
@ -54,5 +57,9 @@
"PHPMailer\\Test\\": "test/" "PHPMailer\\Test\\": "test/"
} }
}, },
"license": "LGPL-2.1-only" "license": "LGPL-2.1-only",
"scripts": {
"check": "./vendor/bin/phpcs",
"test": "./vendor/bin/phpunit"
}
} }

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer - PHP email creation and transport class. * PHPMailer - PHP email creation and transport class.
* PHP Version 5.5 * PHP Version 5.5
@ -16,6 +17,7 @@
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. * FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/** /**
* Get an OAuth2 token from an OAuth2 provider. * Get an OAuth2 token from an OAuth2 provider.
* * Install this script on your server so that it's accessible * * Install this script on your server so that it's accessible
@ -46,10 +48,10 @@ use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
if (!isset($_GET['code']) && !isset($_GET['provider'])) { if (!isset($_GET['code']) && !isset($_GET['provider'])) {
?> ?>
<html> <html>
<body>Select Provider:<br/> <body>Select Provider:<br>
<a href='?provider=Google'>Google</a><br/> <a href='?provider=Google'>Google</a><br>
<a href='?provider=Yahoo'>Yahoo</a><br/> <a href='?provider=Yahoo'>Yahoo</a><br>
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/> <a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br>
</body> </body>
</html> </html>
<?php <?php

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Afrikaans PHPMailer language file: refer to English translation for definitive list * Afrikaans PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Arabic PHPMailer language file: refer to English translation for definitive list * Arabic PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -18,8 +19,7 @@ $PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة ا
$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; $PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; $PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' . $PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : ';
'فشل في الارسال لكل من : ';
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; $PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.';
$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Azerbaijani PHPMailer language file: refer to English translation for definitive list * Azerbaijani PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Bosnian PHPMailer language file: refer to English translation for definitive list * Bosnian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Belarusian PHPMailer language file: refer to English translation for definitive list * Belarusian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Bulgarian PHPMailer language file: refer to English translation for definitive list * Bulgarian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Catalan PHPMailer language file: refer to English translation for definitive list * Catalan PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Chinese PHPMailer language file: refer to English translation for definitive list * Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Czech PHPMailer language file: refer to English translation for definitive list * Czech PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -15,6 +16,8 @@ $PHPMAILER_LANG['file_open'] = 'Chyba souboru: Nelze otevřít soubor
$PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: '; $PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: ';
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvořit instanci emailové funkce.'; $PHPMAILER_LANG['instantiate'] = 'Nelze vytvořit instanci emailové funkce.';
$PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: '; $PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostitele je nesprávný: ';
$PHPMAILER_LANG['invalid_host'] = 'Hostitel je nesprávný: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
$PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správně: '; $PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Danish PHPMailer language file: refer to English translation for definitive list * Danish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* German PHPMailer language file: refer to English translation for definitive list * German PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Greek PHPMailer language file: refer to English translation for definitive list * Greek PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Esperanto PHPMailer language file: refer to English translation for definitive list * Esperanto PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Spanish PHPMailer language file: refer to English translation for definitive list * Spanish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Estonian PHPMailer language file: refer to English translation for definitive list * Estonian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Persian/Farsi PHPMailer language file: refer to English translation for definitive list * Persian/Farsi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Finnish PHPMailer language file: refer to English translation for definitive list * Finnish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Faroese PHPMailer language file: refer to English translation for definitive list * Faroese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* French PHPMailer language file: refer to English translation for definitive list * French PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -19,6 +20,8 @@ $PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible: '
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué: '; $PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué: ';
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; $PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide: '; $PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'L\'entrée hôte n\'est pas valide: ';
$PHPMAILER_LANG['invalid_host'] = 'L\'hôte n\'est pas valide: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP: les destinataires suivants sont en erreur: '; $PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP: les destinataires suivants sont en erreur: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Galician PHPMailer language file: refer to English translation for definitive list * Galician PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Hebrew PHPMailer language file: refer to English translation for definitive list * Hebrew PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Hindi PHPMailer language file: refer to English translation for definitive list * Hindi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Croatian PHPMailer language file: refer to English translation for definitive list * Croatian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Hungarian PHPMailer language file: refer to English translation for definitive list * Hungarian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Armenian PHPMailer language file: refer to English translation for definitive list * Armenian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Indonesian PHPMailer language file: refer to English translation for definitive list * Indonesian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Italian PHPMailer language file: refer to English translation for definitive list * Italian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Japanese PHPMailer language file: refer to English translation for definitive list * Japanese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Georgian PHPMailer language file: refer to English translation for definitive list * Georgian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Korean PHPMailer language file: refer to English translation for definitive list * Korean PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Lithuanian PHPMailer language file: refer to English translation for definitive list * Lithuanian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Latvian PHPMailer language file: refer to English translation for definitive list * Latvian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,9 +1,11 @@
<?php <?php
/** /**
* Malagasy PHPMailer language file: refer to English translation for definitive list * Malagasy PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Hackinet <piyushjha8164@gmail.com> * @author Hackinet <piyushjha8164@gmail.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; $PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Malaysian PHPMailer language file: refer to English translation for definitive list * Malaysian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list * Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Dutch PHPMailer language file: refer to PHPMailer.php for definitive list. * Dutch PHPMailer language file: refer to PHPMailer.php for definitive list.
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Polish PHPMailer language file: refer to English translation for definitive list * Polish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list * Portuguese (European) PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list * Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Romanian PHPMailer language file: refer to English translation for definitive list * Romanian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Russian PHPMailer language file: refer to English translation for definitive list * Russian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Slovak PHPMailer language file: refer to English translation for definitive list * Slovak PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -17,6 +18,8 @@ $PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre č
$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; $PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: ';
$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; $PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; $PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: ';
$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; $PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne ';

View file

@ -1,9 +1,11 @@
<?php <?php
/** /**
* Slovene PHPMailer language file: refer to English translation for definitive list * Slovene PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Klemen Tušar <techouse@gmail.com> * @author Klemen Tušar <techouse@gmail.com>
* @author Filip Š <projects@filips.si> * @author Filip Š <projects@filips.si>
* @author Blaž Oražem <blaz@orazem.si>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.';
@ -17,8 +19,10 @@ $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: ';
$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: ';
$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.';
$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; $PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: ';
$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Serbian PHPMailer language file: refer to English translation for definitive list * Serbian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -0,0 +1,28 @@
<?php
/**
* Serbian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Александар Јевремовић <ajevremovic@gmail.com>
* @author Miloš Milanović <mmilanovic016@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.';
$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.';
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: ';
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: ';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: ';
$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.';
$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.';
$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.';
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.';
$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: ';
$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: ';
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Swedish PHPMailer language file: refer to English translation for definitive list * Swedish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Tagalog PHPMailer language file: refer to English translation for definitive list * Tagalog PHPMailer language file: refer to English translation for definitive list
* *

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Turkish PHPMailer language file: refer to English translation for definitive list * Turkish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Ukrainian PHPMailer language file: refer to English translation for definitive list * Ukrainian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -15,11 +16,11 @@ $PHPMAILER_LANG['file_access'] = 'Немає доступу до фай
$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; $PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: ';
$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; $PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: ';
$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; $PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().';
$PHPMAILER_LANG['provide_address'] = 'Будь-ласка, введіть хоча б одну email-адресу отримувача.'; $PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.';
$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; $PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; $PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: ';
$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; $PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення';
$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через невірний формат email-адреси: '; $PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: ';
$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; $PHPMAILER_LANG['signing'] = 'Помилка підпису: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; $PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером';
$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; $PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list. * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list * Traditional Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list * Simplified Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
backupGlobals="true"
bootstrap="vendor/autoload.php"
verbose="true"
colors="true"
forceCoversAnnotation="false"
>
<testsuites>
<testsuite name="PHPMailerTests">
<directory>./test/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="PHPMailer\Test\DebugLogTestListener" />
</listeners>
<groups>
<exclude>
<group>languages</group>
<group>pop3</group>
</exclude>
</groups>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml"/>
</logging>
</phpunit>

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer Exception class. * PHPMailer Exception class.
* PHP Version 5.5. * PHP Version 5.5.

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer - PHP email creation and transport class. * PHPMailer - PHP email creation and transport class.
* PHP Version 5.5. * PHP Version 5.5.

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer - PHP email creation and transport class. * PHPMailer - PHP email creation and transport class.
* PHP Version 5.5. * PHP Version 5.5.
@ -388,11 +389,11 @@ class PHPMailer
* SMTP class debug output mode. * SMTP class debug output mode.
* Debug output level. * Debug output level.
* Options: * Options:
* * SMTP::DEBUG_OFF: No output * @see SMTP::DEBUG_OFF: No output
* * SMTP::DEBUG_CLIENT: Client messages * @see SMTP::DEBUG_CLIENT: Client messages
* * SMTP::DEBUG_SERVER: Client and server messages * @see SMTP::DEBUG_SERVER: Client and server messages
* * SMTP::DEBUG_CONNECTION: As SERVER plus connection status * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status
* * SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed
* *
* @see SMTP::$do_debug * @see SMTP::$do_debug
* *
@ -427,9 +428,11 @@ class PHPMailer
public $Debugoutput = 'echo'; public $Debugoutput = 'echo';
/** /**
* Whether to keep SMTP connection open after each message. * Whether to keep the SMTP connection open after each message.
* If this is set to true then to close the connection * If this is set to true then the connection will remain open after a send,
* requires an explicit call to smtpClose(). * and closing the connection will require an explicit call to smtpClose().
* It's a good idea to use this if you are sending multiple messages as it reduces overhead.
* See the mailing list example for how to use it.
* *
* @var bool * @var bool
*/ */
@ -747,7 +750,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.1.8'; const VERSION = '6.5.0';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@ -861,18 +864,25 @@ class PHPMailer
$subject = $this->encodeHeader($this->secureHeader($subject)); $subject = $this->encodeHeader($this->secureHeader($subject));
} }
//Calling mail() with null params breaks //Calling mail() with null params breaks
$this->edebug('Sending with mail()');
$this->edebug('Sendmail path: ' . ini_get('sendmail_path'));
$this->edebug("Envelope sender: {$this->Sender}");
$this->edebug("To: {$to}");
$this->edebug("Subject: {$subject}");
$this->edebug("Headers: {$header}");
if (!$this->UseSendmailOptions || null === $params) { if (!$this->UseSendmailOptions || null === $params) {
$result = @mail($to, $subject, $body, $header); $result = @mail($to, $subject, $body, $header);
} else { } else {
$this->edebug("Additional params: {$params}");
$result = @mail($to, $subject, $body, $header, $params); $result = @mail($to, $subject, $body, $header, $params);
} }
$this->edebug('Result: ' . ($result ? 'true' : 'false'));
return $result; return $result;
} }
/** /**
* Output debugging info via user-defined method. * Output debugging info via a user-defined method.
* Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). * Only generates output if debug output is enabled.
* *
* @see PHPMailer::$Debugoutput * @see PHPMailer::$Debugoutput
* @see PHPMailer::$SMTPDebug * @see PHPMailer::$SMTPDebug
@ -1185,9 +1195,20 @@ class PHPMailer
//Use this built-in parser if it's available //Use this built-in parser if it's available
$list = imap_rfc822_parse_adrlist($addrstr, ''); $list = imap_rfc822_parse_adrlist($addrstr, '');
foreach ($list as $address) { foreach ($list as $address) {
if (('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( if (
('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress(
$address->mailbox . '@' . $address->host $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)
) {
$address->personal = mb_decode_mimeheader($address->personal);
}
$addresses[] = [ $addresses[] = [
'name' => (property_exists($address, 'personal') ? $address->personal : ''), 'name' => (property_exists($address, 'personal') ? $address->personal : ''),
'address' => $address->mailbox . '@' . $address->host, 'address' => $address->mailbox . '@' . $address->host,
@ -1211,9 +1232,15 @@ class PHPMailer
} else { } else {
list($name, $email) = explode('<', $address); list($name, $email) = explode('<', $address);
$email = trim(str_replace('>', '', $email)); $email = trim(str_replace('>', '', $email));
$name = trim($name);
if (static::validateAddress($email)) { if (static::validateAddress($email)) {
//If this name is encoded, decode it
if (preg_match('/^=\?.*\?=$/', $name)) {
$name = mb_decode_mimeheader($name);
}
$addresses[] = [ $addresses[] = [
'name' => trim(str_replace(['"', "'"], '', $name)), //Remove any surrounding quotes and spaces from the name
'name' => trim($name, '\'" '),
'address' => $email, 'address' => $email,
]; ];
} }
@ -1241,7 +1268,8 @@ class PHPMailer
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
//Don't validate now addresses with IDN. Will be done in send(). //Don't validate now addresses with IDN. Will be done in send().
$pos = strrpos($address, '@'); $pos = strrpos($address, '@');
if ((false === $pos) if (
(false === $pos)
|| ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported())
&& !static::validateAddress($address)) && !static::validateAddress($address))
) { ) {
@ -1309,7 +1337,8 @@ class PHPMailer
if (null === $patternselect) { if (null === $patternselect) {
$patternselect = static::$validator; $patternselect = static::$validator;
} }
if (is_callable($patternselect)) { //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603
if (is_callable($patternselect) && !is_string($patternselect)) {
return call_user_func($patternselect, $address); return call_user_func($patternselect, $address);
} }
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
@ -1393,21 +1422,26 @@ class PHPMailer
{ {
//Verify we have required functions, CharSet, and at-sign. //Verify we have required functions, CharSet, and at-sign.
$pos = strrpos($address, '@'); $pos = strrpos($address, '@');
if (!empty($this->CharSet) && if (
!empty($this->CharSet) &&
false !== $pos && false !== $pos &&
static::idnSupported() static::idnSupported()
) { ) {
$domain = substr($address, ++$pos); $domain = substr($address, ++$pos);
//Verify CharSet string is a valid one, and domain properly encoded in this CharSet. //Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) {
$domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); //Convert the domain from whatever charset it's in to UTF-8
$domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet);
//Ignore IDE complaints about this line - method signature changed in PHP 5.4 //Ignore IDE complaints about this line - method signature changed in PHP 5.4
$errorcode = 0; $errorcode = 0;
if (defined('INTL_IDNA_VARIANT_UTS46')) { if (defined('INTL_IDNA_VARIANT_UTS46')) {
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); //Use the current punycode standard (appeared in PHP 7.2)
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46);
} elseif (defined('INTL_IDNA_VARIANT_2003')) { } elseif (defined('INTL_IDNA_VARIANT_2003')) {
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003); //Fall back to this old, deprecated/removed encoding
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
} else { } else {
//Fall back to a default we don't know about
$punycode = idn_to_ascii($domain, $errorcode); $punycode = idn_to_ascii($domain, $errorcode);
} }
if (false !== $punycode) { if (false !== $punycode) {
@ -1455,8 +1489,9 @@ class PHPMailer
*/ */
public function preSend() public function preSend()
{ {
if ('smtp' === $this->Mailer if (
|| ('mail' === $this->Mailer && stripos(PHP_OS, 'WIN') === 0) 'smtp' === $this->Mailer
|| ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0))
) { ) {
//SMTP mandates RFC-compliant line endings //SMTP mandates RFC-compliant line endings
//and it's also used with mail() on Windows //and it's also used with mail() on Windows
@ -1466,9 +1501,10 @@ class PHPMailer
static::setLE(PHP_EOL); static::setLE(PHP_EOL);
} }
//Check for buggy PHP versions that add a header with an incorrect line break //Check for buggy PHP versions that add a header with an incorrect line break
if ('mail' === $this->Mailer if (
&& ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017) 'mail' === $this->Mailer
|| (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103)) && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017)
|| (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103))
&& ini_get('mail.add_x_header') === '1' && ini_get('mail.add_x_header') === '1'
&& stripos(PHP_OS, 'WIN') === 0 && stripos(PHP_OS, 'WIN') === 0
) { ) {
@ -1553,7 +1589,8 @@ class PHPMailer
} }
//Sign with DKIM if enabled //Sign with DKIM if enabled
if (!empty($this->DKIM_domain) if (
!empty($this->DKIM_domain)
&& !empty($this->DKIM_selector) && !empty($this->DKIM_selector)
&& (!empty($this->DKIM_private_string) && (!empty($this->DKIM_private_string)
|| (!empty($this->DKIM_private) || (!empty($this->DKIM_private)
@ -1637,22 +1674,44 @@ class PHPMailer
*/ */
protected function sendmailSend($header, $body) protected function sendmailSend($header, $body)
{ {
if ($this->Mailer === 'qmail') {
$this->edebug('Sending with qmail');
} else {
$this->edebug('Sending with sendmail');
}
$header = static::stripTrailingWSP($header) . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
//A space after `-f` is optional, but there is a long history of its presence
//causing problems, so we don't use one
//Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
//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 config has a sender address we can use
$this->Sender = ini_get('sendmail_from');
}
//CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) {
if ('qmail' === $this->Mailer) { if ($this->Mailer === 'qmail') {
$sendmailFmt = '%s -f%s'; $sendmailFmt = '%s -f%s';
} else { } else {
$sendmailFmt = '%s -oi -f%s -t'; $sendmailFmt = '%s -oi -f%s -t';
} }
} elseif ('qmail' === $this->Mailer) {
$sendmailFmt = '%s';
} else { } else {
//allow sendmail to choose a default envelope sender. It may
//seem preferable to force it to use the From header as with
//SMTP, but that introduces new problems (see
//<https://github.com/PHPMailer/PHPMailer/issues/2298>), and
//it has historically worked this way.
$sendmailFmt = '%s -oi -t'; $sendmailFmt = '%s -oi -t';
} }
$sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
$this->edebug('Sendmail path: ' . $this->Sendmail);
$this->edebug('Sendmail command: ' . $sendmail);
$this->edebug('Envelope sender: ' . $this->Sender);
$this->edebug("Headers: {$header}");
if ($this->SingleTo) { if ($this->SingleTo) {
foreach ($this->SingleToArray as $toAddr) { foreach ($this->SingleToArray as $toAddr) {
@ -1660,13 +1719,15 @@ class PHPMailer
if (!$mail) { if (!$mail) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
} }
$this->edebug("To: {$toAddr}");
fwrite($mail, 'To: ' . $toAddr . "\n"); fwrite($mail, 'To: ' . $toAddr . "\n");
fwrite($mail, $header); fwrite($mail, $header);
fwrite($mail, $body); fwrite($mail, $body);
$result = pclose($mail); $result = pclose($mail);
$addrinfo = static::parseAddresses($toAddr);
$this->doCallback( $this->doCallback(
($result === 0), ($result === 0),
[$toAddr], [[$addrinfo['address'], $addrinfo['name']]],
$this->cc, $this->cc,
$this->bcc, $this->bcc,
$this->Subject, $this->Subject,
@ -1674,6 +1735,7 @@ class PHPMailer
$this->From, $this->From,
[] []
); );
$this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
if (0 !== $result) { if (0 !== $result) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
} }
@ -1696,6 +1758,7 @@ class PHPMailer
$this->From, $this->From,
[] []
); );
$this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
if (0 !== $result) { if (0 !== $result) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
} }
@ -1717,7 +1780,8 @@ class PHPMailer
protected static function isShellSafe($string) protected static function isShellSafe($string)
{ {
//Future-proof //Future-proof
if (escapeshellcmd($string) !== $string if (
escapeshellcmd($string) !== $string
|| !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
) { ) {
return false; return false;
@ -1750,7 +1814,8 @@ class PHPMailer
*/ */
protected static function isPermittedPath($path) protected static function isPermittedPath($path)
{ {
return !preg_match('#^[a-z]+://#i', $path); //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
} }
/** /**
@ -1762,12 +1827,15 @@ class PHPMailer
*/ */
protected static function fileIsAccessible($path) protected static function fileIsAccessible($path)
{ {
if (!static::isPermittedPath($path)) {
return false;
}
$readable = file_exists($path); $readable = file_exists($path);
//If not a UNC path (expected to start with \\), check read permission, see #2069 //If not a UNC path (expected to start with \\), check read permission, see #2069
if (strpos($path, '\\\\') !== 0) { if (strpos($path, '\\\\') !== 0) {
$readable = $readable && is_readable($path); $readable = $readable && is_readable($path);
} }
return static::isPermittedPath($path) && $readable; return $readable;
} }
/** /**
@ -1801,10 +1869,14 @@ class PHPMailer
//Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
//Example problem: https://www.drupal.org/node/1057954 //Example problem: https://www.drupal.org/node/1057954
//CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) {
$params = sprintf('-f%s', $this->Sender); //PHP config has a sender address we can use
$this->Sender = ini_get('sendmail_from');
} }
if (!empty($this->Sender) && static::validateAddress($this->Sender)) { if (!empty($this->Sender) && static::validateAddress($this->Sender)) {
if (self::isShellSafe($this->Sender)) {
$params = sprintf('-f%s', $this->Sender);
}
$old_from = ini_get('sendmail_from'); $old_from = ini_get('sendmail_from');
ini_set('sendmail_from', $this->Sender); ini_set('sendmail_from', $this->Sender);
} }
@ -1812,7 +1884,17 @@ class PHPMailer
if ($this->SingleTo && count($toArr) > 1) { if ($this->SingleTo && count($toArr) > 1) {
foreach ($toArr as $toAddr) { foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
$this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); $addrinfo = static::parseAddresses($toAddr);
$this->doCallback(
$result,
[[$addrinfo['address'], $addrinfo['name']]],
$this->cc,
$this->bcc,
$this->Subject,
$body,
$this->From,
[]
);
} }
} else { } else {
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
@ -1901,7 +1983,7 @@ class PHPMailer
$isSent = true; $isSent = true;
} }
$callbacks[] = ['issent'=>$isSent, 'to'=>$to[0]]; $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
} }
} }
@ -1922,7 +2004,7 @@ class PHPMailer
foreach ($callbacks as $cb) { foreach ($callbacks as $cb) {
$this->doCallback( $this->doCallback(
$cb['issent'], $cb['issent'],
[$cb['to']], [[$cb['to'], $cb['name']]],
[], [],
[], [],
$this->Subject, $this->Subject,
@ -1981,11 +2063,13 @@ class PHPMailer
foreach ($hosts as $hostentry) { foreach ($hosts as $hostentry) {
$hostinfo = []; $hostinfo = [];
if (!preg_match( if (
!preg_match(
'/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/',
trim($hostentry), trim($hostentry),
$hostinfo $hostinfo
)) { )
) {
$this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));
//Not a valid host entry //Not a valid host entry
continue; continue;
@ -2010,7 +2094,7 @@ class PHPMailer
$secure = static::ENCRYPTION_SMTPS; $secure = static::ENCRYPTION_SMTPS;
} elseif ('tls' === $hostinfo[1]) { } elseif ('tls' === $hostinfo[1]) {
$tls = true; $tls = true;
// tls doesn't use a prefix //TLS doesn't use a prefix
$secure = static::ENCRYPTION_STARTTLS; $secure = static::ENCRYPTION_STARTTLS;
} }
//Do we need the OpenSSL extension? //Do we need the OpenSSL extension?
@ -2054,12 +2138,14 @@ class PHPMailer
//We must resend EHLO after TLS negotiation //We must resend EHLO after TLS negotiation
$this->smtp->hello($hello); $this->smtp->hello($hello);
} }
if ($this->SMTPAuth && !$this->smtp->authenticate( if (
$this->SMTPAuth && !$this->smtp->authenticate(
$this->Username, $this->Username,
$this->Password, $this->Password,
$this->AuthType, $this->AuthType,
$this->oauth $this->oauth
)) { )
) {
throw new Exception($this->lang('authenticate')); throw new Exception($this->lang('authenticate'));
} }
@ -2099,7 +2185,8 @@ class PHPMailer
* The default language is English. * The default language is English.
* *
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") * @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) * @param string $lang_path Path to the language file directory, with trailing separator (slash).D
* Do not set this from user input!
* *
* @return bool * @return bool
*/ */
@ -2117,7 +2204,7 @@ class PHPMailer
'am' => 'hy', 'am' => 'hy',
]; ];
if (isset($renamed_langcodes[$langcode])) { if (array_key_exists($langcode, $renamed_langcodes)) {
$langcode = $renamed_langcodes[$langcode]; $langcode = $renamed_langcodes[$langcode];
} }
@ -2161,14 +2248,32 @@ class PHPMailer
if (!static::fileIsAccessible($lang_file)) { if (!static::fileIsAccessible($lang_file)) {
$foundlang = false; $foundlang = false;
} else { } else {
// Overwrite language-specific strings. //$foundlang = include $lang_file;
// This way we'll never have missing translation keys. $lines = file($lang_file);
$foundlang = include $lang_file; foreach ($lines as $line) {
//Translation file lines look like this:
//$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
//These files are parsed as text and not PHP so as to avoid the possibility of code injection
//See https://blog.stevenlevithan.com/archives/match-quoted-string
$matches = [];
if (
preg_match(
'/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/',
$line,
$matches
) &&
//Ignore unknown translation keys
array_key_exists($matches[1], $PHPMAILER_LANG)
) {
//Overwrite language-specific strings so we'll never have missing translation keys.
$PHPMAILER_LANG[$matches[1]] = (string)$matches[3];
}
}
} }
} }
$this->language = $PHPMAILER_LANG; $this->language = $PHPMAILER_LANG;
return (bool) $foundlang; // Returns false if language not found return $foundlang; //Returns false if language not found
} }
/** /**
@ -2426,7 +2531,8 @@ class PHPMailer
} }
//sendmail and mail() extract Bcc from the header before sending //sendmail and mail() extract Bcc from the header before sending
if (( if (
(
'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer
) )
&& count($this->bcc) > 0 && count($this->bcc) > 0
@ -2530,10 +2636,6 @@ class PHPMailer
} }
} }
if ('mail' !== $this->Mailer) {
// $result .= static::$LE;
}
return $result; return $result;
} }
@ -3896,7 +3998,8 @@ class PHPMailer
public static function isValidHost($host) public static function isValidHost($host)
{ {
//Simple syntax limits //Simple syntax limits
if (empty($host) if (
empty($host)
|| !is_string($host) || !is_string($host)
|| strlen($host) > 256 || 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)
@ -3931,13 +4034,13 @@ class PHPMailer
protected function lang($key) protected function lang($key)
{ {
if (count($this->language) < 1) { if (count($this->language) < 1) {
$this->setLanguage(); // set the default language $this->setLanguage(); //Set the default language
} }
if (array_key_exists($key, $this->language)) { if (array_key_exists($key, $this->language)) {
if ('smtp_connect_failed' === $key) { if ('smtp_connect_failed' === $key) {
//Include a link to troubleshooting docs on SMTP connection failure //Include a link to troubleshooting docs on SMTP connection failure.
//this is by far the biggest cause of support questions //This is by far the biggest cause of support questions
//but it's usually not PHPMailer's fault. //but it's usually not PHPMailer's fault.
return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
} }
@ -4062,7 +4165,8 @@ class PHPMailer
); );
continue; continue;
} }
if (// Only process relative URLs if a basedir is provided (i.e. no absolute local paths) if (
//Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
!empty($basedir) !empty($basedir)
//Ignore URLs containing parent dir traversal (..) //Ignore URLs containing parent dir traversal (..)
&& (strpos($url, '..') === false) && (strpos($url, '..') === false)
@ -4084,7 +4188,8 @@ class PHPMailer
if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { if (strlen($directory) > 1 && '/' !== substr($directory, -1)) {
$directory .= '/'; $directory .= '/';
} }
if ($this->addEmbeddedImage( if (
$this->addEmbeddedImage(
$basedir . $directory . $filename, $basedir . $directory . $filename,
$cid, $cid,
$filename, $filename,
@ -4509,11 +4614,15 @@ class PHPMailer
$privKey = openssl_pkey_get_private($privKeyStr); $privKey = openssl_pkey_get_private($privKeyStr);
} }
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
if (\PHP_MAJOR_VERSION < 8) {
openssl_pkey_free($privKey); openssl_pkey_free($privKey);
}
return base64_encode($signature); return base64_encode($signature);
} }
if (\PHP_MAJOR_VERSION < 8) {
openssl_pkey_free($privKey); openssl_pkey_free($privKey);
}
return ''; return '';
} }
@ -4701,7 +4810,8 @@ class PHPMailer
$headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE;
$headerValues = implode(static::$LE, $headersToSign); $headerValues = implode(static::$LE, $headersToSign);
$body = $this->DKIM_BodyC($body); $body = $this->DKIM_BodyC($body);
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body //Base64 of packed binary SHA-256 hash of body
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body)));
$ident = ''; $ident = '';
if ('' !== $this->DKIM_identity) { if ('' !== $this->DKIM_identity) {
$ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE;

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer POP-Before-SMTP Authentication Class. * PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5.5. * PHP Version 5.5.
@ -45,7 +46,7 @@ class POP3
* *
* @var string * @var string
*/ */
const VERSION = '6.1.8'; const VERSION = '6.5.0';
/** /**
* Default POP3 port number. * Default POP3 port number.
@ -62,12 +63,16 @@ class POP3
const DEFAULT_TIMEOUT = 30; const DEFAULT_TIMEOUT = 30;
/** /**
* Debug display level. * POP3 class debug output mode.
* Options: 0 = no, 1+ = yes. * Debug output level.
* Options:
* @see POP3::DEBUG_OFF: No output
* @see POP3::DEBUG_SERVER: Server messages, connection/server errors
* @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors
* *
* @var int * @var int
*/ */
public $do_debug = 0; public $do_debug = self::DEBUG_OFF;
/** /**
* POP3 mail server hostname. * POP3 mail server hostname.
@ -130,6 +135,28 @@ class POP3
*/ */
const LE = "\r\n"; const LE = "\r\n";
/**
* Debug level for no output.
*
* @var int
*/
const DEBUG_OFF = 0;
/**
* Debug level to show server -> client messages
* also shows clients connection errors or errors from server
*
* @var int
*/
const DEBUG_SERVER = 1;
/**
* Debug level to show client -> server and server -> client messages.
*
* @var int
*/
const DEBUG_CLIENT = 2;
/** /**
* Simple static wrapper for all-in-one POP before SMTP. * Simple static wrapper for all-in-one POP before SMTP.
* *
@ -189,7 +216,7 @@ class POP3
$this->password = $password; $this->password = $password;
//Reset the error log //Reset the error log
$this->errors = []; $this->errors = [];
// connect //Connect
$result = $this->connect($this->host, $this->port, $this->tval); $result = $this->connect($this->host, $this->port, $this->tval);
if ($result) { if ($result) {
$login_result = $this->login($this->username, $this->password); $login_result = $this->login($this->username, $this->password);
@ -229,7 +256,7 @@ class POP3
$port = static::DEFAULT_PORT; $port = static::DEFAULT_PORT;
} }
// connect to the POP3 server //Connect to the POP3 server
$errno = 0; $errno = 0;
$errstr = ''; $errstr = '';
$this->pop_conn = fsockopen( $this->pop_conn = fsockopen(
@ -329,7 +356,7 @@ class POP3
protected function getResponse($size = 128) protected function getResponse($size = 128)
{ {
$response = fgets($this->pop_conn, $size); $response = fgets($this->pop_conn, $size);
if ($this->do_debug >= 1) { if ($this->do_debug >= self::DEBUG_SERVER) {
echo 'Server -> Client: ', $response; echo 'Server -> Client: ', $response;
} }
@ -346,7 +373,7 @@ class POP3
protected function sendString($string) protected function sendString($string)
{ {
if ($this->pop_conn) { if ($this->pop_conn) {
if ($this->do_debug >= 2) { //Show client messages when debug >= 2 if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2
echo 'Client -> Server: ', $string; echo 'Client -> Server: ', $string;
} }
@ -384,7 +411,7 @@ class POP3
protected function setError($error) protected function setError($error)
{ {
$this->errors[] = $error; $this->errors[] = $error;
if ($this->do_debug >= 1) { if ($this->do_debug >= self::DEBUG_SERVER) {
echo '<pre>'; echo '<pre>';
foreach ($this->errors as $e) { foreach ($this->errors as $e) {
print_r($e); print_r($e);

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer RFC821 SMTP email transport class. * PHPMailer RFC821 SMTP email transport class.
* PHP Version 5.5. * PHP Version 5.5.
@ -34,7 +35,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.1.8'; const VERSION = '6.5.0';
/** /**
* SMTP line break constant. * SMTP line break constant.
@ -185,6 +186,7 @@ class SMTP
'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/',
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
]; ];
/** /**
@ -342,9 +344,21 @@ class SMTP
//Get any announcement //Get any announcement
$this->last_reply = $this->get_lines(); $this->last_reply = $this->get_lines();
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
$responseCode = (int)substr($this->last_reply, 0, 3);
if ($responseCode === 220) {
return true; return true;
} }
//Anything other than a 220 response means something went wrong
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
//https://tools.ietf.org/html/rfc5321#section-3.1
if ($responseCode === 554) {
$this->quit();
}
//This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down)
$this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION);
$this->close();
return false;
}
/** /**
* Create connection to the SMTP server. * Create connection to the SMTP server.
@ -539,7 +553,10 @@ class SMTP
return false; return false;
} }
//Send encoded username and password //Send encoded username and password
if (!$this->sendCommand( if (
//Format from https://tools.ietf.org/html/rfc4616#section-2
//We skip the first field (it's forgery), so the string starts with a null byte
!$this->sendCommand(
'User & Password', 'User & Password',
base64_encode("\0" . $username . "\0" . $password), base64_encode("\0" . $username . "\0" . $password),
235 235
@ -669,7 +686,7 @@ class SMTP
$this->server_caps = null; $this->server_caps = null;
$this->helo_rply = null; $this->helo_rply = null;
if (is_resource($this->smtp_conn)) { if (is_resource($this->smtp_conn)) {
// close the connection and cleanup //Close the connection and cleanup
fclose($this->smtp_conn); fclose($this->smtp_conn);
$this->smtp_conn = null; //Makes for cleaner serialization $this->smtp_conn = null; //Makes for cleaner serialization
$this->edebug('Connection: closed', self::DEBUG_CONNECTION); $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
@ -750,7 +767,8 @@ class SMTP
//Send the lines to the server //Send the lines to the server
foreach ($lines_out as $line_out) { foreach ($lines_out as $line_out) {
//RFC2821 section 4.5.2 //Dot-stuffing as per RFC5321 section 4.5.2
//https://tools.ietf.org/html/rfc5321#section-4.5.2
if (!empty($line_out) && $line_out[0] === '.') { if (!empty($line_out) && $line_out[0] === '.') {
$line_out = '.' . $line_out; $line_out = '.' . $line_out;
} }
@ -784,7 +802,16 @@ class SMTP
public function hello($host = '') public function hello($host = '')
{ {
//Try extended hello first (RFC 2821) //Try extended hello first (RFC 2821)
return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host); if ($this->sendHello('EHLO', $host)) {
return true;
}
//Some servers shut down the SMTP service here (RFC 5321)
if (substr($this->helo_rply, 0, 3) == '421') {
return false;
}
return $this->sendHello('HELO', $host);
} }
/** /**
@ -1086,8 +1113,10 @@ class SMTP
{ {
//If SMTP transcripts are left enabled, or debug output is posted online //If SMTP transcripts are left enabled, or debug output is posted online
//it can leak credentials, so hide credentials in all but lowest level //it can leak credentials, so hide credentials in all but lowest level
if (self::DEBUG_LOWLEVEL > $this->do_debug && if (
in_array($command, ['User & Password', 'Username', 'Password'], true)) { self::DEBUG_LOWLEVEL > $this->do_debug &&
in_array($command, ['User & Password', 'Username', 'Password'], true)
) {
$this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);
} else { } else {
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
@ -1207,7 +1236,8 @@ class SMTP
self::DEBUG_LOWLEVEL self::DEBUG_LOWLEVEL
); );
//stream_select returns false when the `select` system call is interrupted by an incoming signal, try the select again //stream_select returns false when the `select` system call is interrupted
//by an incoming signal, try the select again
if (stripos($message, 'interrupted system call') !== false) { if (stripos($message, 'interrupted system call') !== false) {
$this->edebug( $this->edebug(
'SMTP -> get_lines(): retrying stream_select', 'SMTP -> get_lines(): retrying stream_select',

View file

@ -1,7 +1,13 @@
{ {
"name": "chevereto/chevereto-free", "license": "MIT",
"description": "Chevereto Free",
"type": "project", "type": "project",
"name": "chevereto/chevereto-free",
"description": "Community/Personal Image Hosting powered by Chevereto (图床)",
"homepage": "https://chevereto.com/free",
"keywords": [
"image-hosting",
"gallery"
],
"authors": [ "authors": [
{ {
"name": "Rodolfo Berrios", "name": "Rodolfo Berrios",
@ -9,6 +15,11 @@
} }
], ],
"require": { "require": {
"php": "~7.4",
"ext-bcmath": "*",
"ext-exif": "*",
"ext-gd": "*",
"ext-json": "*",
"phpmailer/phpmailer": "~6.0", "phpmailer/phpmailer": "~6.0",
"jbroadway/urlify": "~1.1.2", "jbroadway/urlify": "~1.1.2",
"mobiledetect/mobiledetectlib": "^2.8", "mobiledetect/mobiledetectlib": "^2.8",

53
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "043c4d7ae29fec225087daa060aef674", "content-hash": "c327c453cbbc5ce5f47457d928e1f301",
"packages": [ "packages": [
{ {
"name": "jbroadway/urlify", "name": "jbroadway/urlify",
@ -69,16 +69,16 @@
}, },
{ {
"name": "mobiledetect/mobiledetectlib", "name": "mobiledetect/mobiledetectlib",
"version": "2.8.34", "version": "2.8.37",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/serbanghita/Mobile-Detect.git", "url": "https://github.com/serbanghita/Mobile-Detect.git",
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b" "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/9841e3c46f5bd0739b53aed8ac677fa712943df7",
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -119,22 +119,28 @@
], ],
"support": { "support": {
"issues": "https://github.com/serbanghita/Mobile-Detect/issues", "issues": "https://github.com/serbanghita/Mobile-Detect/issues",
"source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.34" "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.37"
}, },
"time": "2019-09-18T18:44:20+00:00" "funding": [
{
"url": "https://github.com/serbanghita",
"type": "github"
}
],
"time": "2021-02-19T21:22:57+00:00"
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.1.8", "version": "v6.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1" "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/917ab212fa00dc6eacbb26e8bc387ebe40993bc1", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1", "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -144,12 +150,15 @@
"php": ">=5.5.0" "php": ">=5.5.0"
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2", "doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2", "phpcompatibility/php-compatibility": "^9.3.5",
"phpunit/phpunit": "^4.8 || ^5.7" "roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5.6",
"yoast/phpunit-polyfills": "^0.2.0"
}, },
"suggest": { "suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging", "psr/log": "For optional PSR-3 debug logging",
@ -186,15 +195,15 @@
"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.1.8" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0"
}, },
"funding": [ "funding": [
{ {
"url": "https://github.com/synchro", "url": "https://github.com/Synchro",
"type": "github" "type": "github"
} }
], ],
"time": "2020-10-09T14:55:58+00:00" "time": "2021-06-16T14:33:43+00:00"
}, },
{ {
"name": "tijsverkoyen/akismet", "name": "tijsverkoyen/akismet",
@ -246,7 +255,13 @@
"stability-flags": [], "stability-flags": [],
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": {
"php": "~7.4",
"ext-bcmath": "*",
"ext-exif": "*",
"ext-gd": "*",
"ext-json": "*"
},
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.0.0" "plugin-api-version": "2.1.0"
} }