diff --git a/composer.json b/composer.json index 3db84ca6e..8663cf618 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,6 @@ "phpmailer/phpmailer": "^6.2.0", "ifsnop/mysqldump-php": "^2.9", "matthiasmullie/minify": "^1.3.65", - "intervention/image": "^2.5.1", - "": "" + "intervention/image": "^2.5.1" } } diff --git a/composer.lock b/composer.lock index 58eae9777..b98ad62d0 100644 --- a/composer.lock +++ b/composer.lock @@ -6,72 +6,18 @@ ], "content-hash": "12129f1e8aec686d7cae22b9281fe71d", "packages": [ - { - "name": "firebase/php-jwt", - "version": "v5.2.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb", - "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4.8 <=9" - }, - "type": "library", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ], - "support": { - "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/master" - }, - "time": "2020-03-25T18:49:23+00:00" - }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "shasum": "" }, "require": { @@ -131,32 +77,34 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" + "source": "https://github.com/guzzle/psr7/tree/1.8.1" }, - "time": "2020-09-30T07:37:11+00:00" + "time": "2021-03-21T16:25:00+00:00" }, { "name": "hybridauth/hybridauth", - "version": "3.6.0", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/hybridauth/hybridauth.git", - "reference": "222ab4e6ee6ffd81caa77283142f3aa97afa5863" + "reference": "0ec1b8cb8b230aae739422c5e42bc5733b3a7316" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/222ab4e6ee6ffd81caa77283142f3aa97afa5863", - "reference": "222ab4e6ee6ffd81caa77283142f3aa97afa5863", + "url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/0ec1b8cb8b230aae739422c5e42bc5733b3a7316", + "reference": "0ec1b8cb8b230aae739422c5e42bc5733b3a7316", "shasum": "" }, "require": { - "firebase/php-jwt": "*", - "php": ">=5.4.0", - "phpseclib/phpseclib": "~2.0" + "php": "^5.4 || ^7.0 || ^8.0" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8" + "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8.0" + }, + "suggest": { + "firebase/php-jwt": "Needed to support Apple provider", + "phpseclib/phpseclib": "Needed to support Apple provider" }, "type": "library", "autoload": { @@ -191,9 +139,9 @@ "support": { "gitter": "https://gitter.im/hybridauth/hybridauth", "issues": "https://github.com/hybridauth/hybridauth/issues", - "source": "https://github.com/hybridauth/hybridauth/tree/3.6.0" + "source": "https://github.com/hybridauth/hybridauth/tree/3.7.1" }, - "time": "2020-10-21T16:32:08+00:00" + "time": "2021-03-13T17:35:33+00:00" }, { "name": "ifsnop/mysqldump-php", @@ -330,16 +278,16 @@ }, { "name": "matthiasmullie/minify", - "version": "1.3.65", + "version": "1.3.66", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "227f19062451c55a797e0cc667ef983834e6580c" + "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c", - "reference": "227f19062451c55a797e0cc667ef983834e6580c", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/45fd3b0f1dfa2c965857c6d4a470bea52adc31a6", + "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6", "shasum": "" }, "require": { @@ -349,8 +297,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.0", - "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8" + "matthiasmullie/scrapbook": "dev-master", + "phpunit/phpunit": ">=4.8" }, "suggest": { "psr/cache-implementation": "Cache implementation to use with Minify::cache" @@ -388,7 +336,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.65" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.66" }, "funding": [ { @@ -404,7 +352,7 @@ "type": "github" } ], - "time": "2020-12-27T21:43:29+00:00" + "time": "2021-01-06T15:18:10+00:00" }, { "name": "matthiasmullie/path-converter", @@ -461,16 +409,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.2.0", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "e38888a75c070304ca5514197d4847a59a5c853f" + "reference": "050d430203105c27c30efd1dce7aa421ad882d01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e38888a75c070304ca5514197d4847a59a5c853f", - "reference": "e38888a75c070304ca5514197d4847a59a5c853f", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01", + "reference": "050d430203105c27c30efd1dce7aa421ad882d01", "shasum": "" }, "require": { @@ -488,7 +436,7 @@ "yoast/phpunit-polyfills": "^0.2.0" }, "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", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", @@ -525,7 +473,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.2.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.0" }, "funding": [ { @@ -533,116 +481,7 @@ "type": "github" } ], - "time": "2020-11-25T15:24:57+00:00" - }, - { - "name": "phpseclib/phpseclib", - "version": "2.0.30", - "source": { - "type": "git", - "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", - "squizlabs/php_codesniffer": "~2.0" - }, - "suggest": { - "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", - "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", - "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." - }, - "type": "library", - "autoload": { - "files": [ - "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib\\": "phpseclib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jim Wigginton", - "email": "terrafrost@php.net", - "role": "Lead Developer" - }, - { - "name": "Patrick Monnerat", - "email": "pm@datasphere.ch", - "role": "Developer" - }, - { - "name": "Andreas Fischer", - "email": "bantu@phpbb.com", - "role": "Developer" - }, - { - "name": "Hans-Jürgen Petrich", - "email": "petrich@tronic-media.com", - "role": "Developer" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com", - "role": "Developer" - } - ], - "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", - "homepage": "http://phpseclib.sourceforge.net", - "keywords": [ - "BigInteger", - "aes", - "asn.1", - "asn1", - "blowfish", - "crypto", - "cryptography", - "encryption", - "rsa", - "security", - "sftp", - "signature", - "signing", - "ssh", - "twofish", - "x.509", - "x509" - ], - "support": { - "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.30" - }, - "funding": [ - { - "url": "https://github.com/terrafrost", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpseclib", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", - "type": "tidelift" - } - ], - "time": "2020-12-17T05:42:04+00:00" + "time": "2021-03-31T20:06:42+00:00" }, { "name": "psr/http-message", diff --git a/e107_handlers/vendor/composer/InstalledVersions.php b/e107_handlers/vendor/composer/InstalledVersions.php index 4d42ad028..63b7719c3 100644 --- a/e107_handlers/vendor/composer/InstalledVersions.php +++ b/e107_handlers/vendor/composer/InstalledVersions.php @@ -29,7 +29,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b', + 'reference' => '2862e18db94899361a4d5be20c3e2d990b79e67a', 'name' => 'e107inc/e107', ), 'versions' => @@ -41,34 +41,25 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b', - ), - 'firebase/php-jwt' => - array ( - 'pretty_version' => 'v5.2.0', - 'version' => '5.2.0.0', - 'aliases' => - array ( - ), - 'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb', + 'reference' => '2862e18db94899361a4d5be20c3e2d990b79e67a', ), 'guzzlehttp/psr7' => array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', + 'pretty_version' => '1.8.1', + 'version' => '1.8.1.0', 'aliases' => array ( ), - 'reference' => '53330f47520498c0ae1f61f7e2c90f55690c06a3', + 'reference' => '35ea11d335fd638b5882ff1725228b3d35496ab1', ), 'hybridauth/hybridauth' => array ( - 'pretty_version' => '3.6.0', - 'version' => '3.6.0.0', + 'pretty_version' => '3.7.1', + 'version' => '3.7.1.0', 'aliases' => array ( ), - 'reference' => '222ab4e6ee6ffd81caa77283142f3aa97afa5863', + 'reference' => '0ec1b8cb8b230aae739422c5e42bc5733b3a7316', ), 'ifsnop/mysqldump-php' => array ( @@ -90,12 +81,12 @@ private static $installed = array ( ), 'matthiasmullie/minify' => array ( - 'pretty_version' => '1.3.65', - 'version' => '1.3.65.0', + 'pretty_version' => '1.3.66', + 'version' => '1.3.66.0', 'aliases' => array ( ), - 'reference' => '227f19062451c55a797e0cc667ef983834e6580c', + 'reference' => '45fd3b0f1dfa2c965857c6d4a470bea52adc31a6', ), 'matthiasmullie/path-converter' => array ( @@ -108,21 +99,12 @@ private static $installed = array ( ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', + 'pretty_version' => 'v6.4.0', + 'version' => '6.4.0.0', 'aliases' => array ( ), - 'reference' => 'e38888a75c070304ca5514197d4847a59a5c853f', - ), - 'phpseclib/phpseclib' => - array ( - 'pretty_version' => '2.0.30', - 'version' => '2.0.30.0', - 'aliases' => - array ( - ), - 'reference' => '136b9ca7eebef78be14abf90d65c5e57b6bc5d36', + 'reference' => '050d430203105c27c30efd1dce7aa421ad882d01', ), 'psr/http-message' => array ( diff --git a/e107_handlers/vendor/composer/autoload_files.php b/e107_handlers/vendor/composer/autoload_files.php index 661ba4836..d3964b69e 100644 --- a/e107_handlers/vendor/composer/autoload_files.php +++ b/e107_handlers/vendor/composer/autoload_files.php @@ -8,5 +8,4 @@ $baseDir = dirname(dirname($vendorDir)); return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', ); diff --git a/e107_handlers/vendor/composer/autoload_psr4.php b/e107_handlers/vendor/composer/autoload_psr4.php index c9e607212..8747983d0 100644 --- a/e107_handlers/vendor/composer/autoload_psr4.php +++ b/e107_handlers/vendor/composer/autoload_psr4.php @@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( - 'phpseclib\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), 'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'), @@ -15,5 +14,4 @@ return array( 'Ifsnop\\' => array($vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop'), 'Hybridauth\\' => array($vendorDir . '/hybridauth/hybridauth/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), ); diff --git a/e107_handlers/vendor/composer/autoload_static.php b/e107_handlers/vendor/composer/autoload_static.php index 91a92421c..ec9f14c4b 100644 --- a/e107_handlers/vendor/composer/autoload_static.php +++ b/e107_handlers/vendor/composer/autoload_static.php @@ -9,14 +9,9 @@ class ComposerStaticInit4ce406ae486ac58c9aa71537459207ae public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( - 'p' => - array ( - 'phpseclib\\' => 10, - ), 'P' => array ( 'Psr\\Http\\Message\\' => 17, @@ -40,17 +35,9 @@ class ComposerStaticInit4ce406ae486ac58c9aa71537459207ae array ( 'GuzzleHttp\\Psr7\\' => 16, ), - 'F' => - array ( - 'Firebase\\JWT\\' => 13, - ), ); public static $prefixDirsPsr4 = array ( - 'phpseclib\\' => - array ( - 0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib', - ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-message/src', @@ -83,10 +70,6 @@ class ComposerStaticInit4ce406ae486ac58c9aa71537459207ae array ( 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', ), - 'Firebase\\JWT\\' => - array ( - 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', - ), ); public static $classMap = array ( diff --git a/e107_handlers/vendor/composer/installed.json b/e107_handlers/vendor/composer/installed.json index 16b3d1aa3..13a2893e1 100644 --- a/e107_handlers/vendor/composer/installed.json +++ b/e107_handlers/vendor/composer/installed.json @@ -1,75 +1,18 @@ { "packages": [ - { - "name": "firebase/php-jwt", - "version": "v5.2.0", - "version_normalized": "5.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb", - "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4.8 <=9" - }, - "time": "2020-03-25T18:49:23+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ], - "support": { - "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/master" - }, - "install-path": "../firebase/php-jwt" - }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", - "version_normalized": "1.7.0.0", + "version": "1.8.1", + "version_normalized": "1.8.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "shasum": "" }, "require": { @@ -87,7 +30,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2020-09-30T07:37:11+00:00", + "time": "2021-03-21T16:25:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -131,35 +74,37 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" + "source": "https://github.com/guzzle/psr7/tree/1.8.1" }, "install-path": "../guzzlehttp/psr7" }, { "name": "hybridauth/hybridauth", - "version": "3.6.0", - "version_normalized": "3.6.0.0", + "version": "3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/hybridauth/hybridauth.git", - "reference": "222ab4e6ee6ffd81caa77283142f3aa97afa5863" + "reference": "0ec1b8cb8b230aae739422c5e42bc5733b3a7316" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/222ab4e6ee6ffd81caa77283142f3aa97afa5863", - "reference": "222ab4e6ee6ffd81caa77283142f3aa97afa5863", + "url": "https://api.github.com/repos/hybridauth/hybridauth/zipball/0ec1b8cb8b230aae739422c5e42bc5733b3a7316", + "reference": "0ec1b8cb8b230aae739422c5e42bc5733b3a7316", "shasum": "" }, "require": { - "firebase/php-jwt": "*", - "php": ">=5.4.0", - "phpseclib/phpseclib": "~2.0" + "php": "^5.4 || ^7.0 || ^8.0" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8" + "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8.0" }, - "time": "2020-10-21T16:32:08+00:00", + "suggest": { + "firebase/php-jwt": "Needed to support Apple provider", + "phpseclib/phpseclib": "Needed to support Apple provider" + }, + "time": "2021-03-13T17:35:33+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -194,7 +139,7 @@ "support": { "gitter": "https://gitter.im/hybridauth/hybridauth", "issues": "https://github.com/hybridauth/hybridauth/issues", - "source": "https://github.com/hybridauth/hybridauth/tree/3.6.0" + "source": "https://github.com/hybridauth/hybridauth/tree/3.7.1" }, "install-path": "../hybridauth/hybridauth" }, @@ -335,17 +280,17 @@ }, { "name": "matthiasmullie/minify", - "version": "1.3.65", - "version_normalized": "1.3.65.0", + "version": "1.3.66", + "version_normalized": "1.3.66.0", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "227f19062451c55a797e0cc667ef983834e6580c" + "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c", - "reference": "227f19062451c55a797e0cc667ef983834e6580c", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/45fd3b0f1dfa2c965857c6d4a470bea52adc31a6", + "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6", "shasum": "" }, "require": { @@ -355,13 +300,13 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.0", - "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8" + "matthiasmullie/scrapbook": "dev-master", + "phpunit/phpunit": ">=4.8" }, "suggest": { "psr/cache-implementation": "Cache implementation to use with Minify::cache" }, - "time": "2020-12-27T21:43:29+00:00", + "time": "2021-01-06T15:18:10+00:00", "bin": [ "bin/minifycss", "bin/minifyjs" @@ -396,7 +341,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.65" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.66" }, "funding": [ { @@ -472,17 +417,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", + "version": "v6.4.0", + "version_normalized": "6.4.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "e38888a75c070304ca5514197d4847a59a5c853f" + "reference": "050d430203105c27c30efd1dce7aa421ad882d01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e38888a75c070304ca5514197d4847a59a5c853f", - "reference": "e38888a75c070304ca5514197d4847a59a5c853f", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01", + "reference": "050d430203105c27c30efd1dce7aa421ad882d01", "shasum": "" }, "require": { @@ -500,14 +445,14 @@ "yoast/phpunit-polyfills": "^0.2.0" }, "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", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", "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)" }, - "time": "2020-11-25T15:24:57+00:00", + "time": "2021-03-31T20:06:42+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -539,7 +484,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.2.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.0" }, "funding": [ { @@ -549,118 +494,6 @@ ], "install-path": "../phpmailer/phpmailer" }, - { - "name": "phpseclib/phpseclib", - "version": "2.0.30", - "version_normalized": "2.0.30.0", - "source": { - "type": "git", - "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", - "squizlabs/php_codesniffer": "~2.0" - }, - "suggest": { - "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", - "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", - "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." - }, - "time": "2020-12-17T05:42:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib\\": "phpseclib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jim Wigginton", - "email": "terrafrost@php.net", - "role": "Lead Developer" - }, - { - "name": "Patrick Monnerat", - "email": "pm@datasphere.ch", - "role": "Developer" - }, - { - "name": "Andreas Fischer", - "email": "bantu@phpbb.com", - "role": "Developer" - }, - { - "name": "Hans-Jürgen Petrich", - "email": "petrich@tronic-media.com", - "role": "Developer" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com", - "role": "Developer" - } - ], - "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", - "homepage": "http://phpseclib.sourceforge.net", - "keywords": [ - "BigInteger", - "aes", - "asn.1", - "asn1", - "blowfish", - "crypto", - "cryptography", - "encryption", - "rsa", - "security", - "sftp", - "signature", - "signing", - "ssh", - "twofish", - "x.509", - "x509" - ], - "support": { - "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.30" - }, - "funding": [ - { - "url": "https://github.com/terrafrost", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpseclib", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", - "type": "tidelift" - } - ], - "install-path": "../phpseclib/phpseclib" - }, { "name": "psr/http-message", "version": "1.0.1", diff --git a/e107_handlers/vendor/composer/installed.php b/e107_handlers/vendor/composer/installed.php index 79d54a967..e2e46eb99 100644 --- a/e107_handlers/vendor/composer/installed.php +++ b/e107_handlers/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b', + 'reference' => '2862e18db94899361a4d5be20c3e2d990b79e67a', 'name' => 'e107inc/e107', ), 'versions' => @@ -18,34 +18,25 @@ 'aliases' => array ( ), - 'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b', - ), - 'firebase/php-jwt' => - array ( - 'pretty_version' => 'v5.2.0', - 'version' => '5.2.0.0', - 'aliases' => - array ( - ), - 'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb', + 'reference' => '2862e18db94899361a4d5be20c3e2d990b79e67a', ), 'guzzlehttp/psr7' => array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', + 'pretty_version' => '1.8.1', + 'version' => '1.8.1.0', 'aliases' => array ( ), - 'reference' => '53330f47520498c0ae1f61f7e2c90f55690c06a3', + 'reference' => '35ea11d335fd638b5882ff1725228b3d35496ab1', ), 'hybridauth/hybridauth' => array ( - 'pretty_version' => '3.6.0', - 'version' => '3.6.0.0', + 'pretty_version' => '3.7.1', + 'version' => '3.7.1.0', 'aliases' => array ( ), - 'reference' => '222ab4e6ee6ffd81caa77283142f3aa97afa5863', + 'reference' => '0ec1b8cb8b230aae739422c5e42bc5733b3a7316', ), 'ifsnop/mysqldump-php' => array ( @@ -67,12 +58,12 @@ ), 'matthiasmullie/minify' => array ( - 'pretty_version' => '1.3.65', - 'version' => '1.3.65.0', + 'pretty_version' => '1.3.66', + 'version' => '1.3.66.0', 'aliases' => array ( ), - 'reference' => '227f19062451c55a797e0cc667ef983834e6580c', + 'reference' => '45fd3b0f1dfa2c965857c6d4a470bea52adc31a6', ), 'matthiasmullie/path-converter' => array ( @@ -85,21 +76,12 @@ ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', + 'pretty_version' => 'v6.4.0', + 'version' => '6.4.0.0', 'aliases' => array ( ), - 'reference' => 'e38888a75c070304ca5514197d4847a59a5c853f', - ), - 'phpseclib/phpseclib' => - array ( - 'pretty_version' => '2.0.30', - 'version' => '2.0.30.0', - 'aliases' => - array ( - ), - 'reference' => '136b9ca7eebef78be14abf90d65c5e57b6bc5d36', + 'reference' => '050d430203105c27c30efd1dce7aa421ad882d01', ), 'psr/http-message' => array ( diff --git a/e107_handlers/vendor/guzzlehttp/psr7/CHANGELOG.md b/e107_handlers/vendor/guzzlehttp/psr7/CHANGELOG.md index b441d3666..a608aa419 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/e107_handlers/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -9,6 +9,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.8.1] - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## [1.8.0] - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + ## [1.7.0] - 2020-09-30 ### Added diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/AppendStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/AppendStream.php index 86e7a23ba..fa9153d78 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -8,6 +8,8 @@ use Psr\Http\Message\StreamInterface; * Reads from multiple streams, one after the other. * * This is a read-only stream decorator. + * + * @final */ class AppendStream implements StreamInterface { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/BufferStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/BufferStream.php index 627e4a5f1..783859c19 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -11,6 +11,8 @@ use Psr\Http\Message\StreamInterface; * This stream returns a "hwm" metadata value that tells upstream consumers * what the configured high water mark of the stream is, or the maximum * preferred size of the buffer. + * + * @final */ class BufferStream implements StreamInterface { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/CachingStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/CachingStream.php index 244d2a063..fe749e981 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface; /** * Stream decorator that can cache previously read bytes from a sequentially * read stream. + * + * @final */ class CachingStream implements StreamInterface { @@ -21,7 +23,7 @@ class CachingStream implements StreamInterface /** * We will treat the buffer object as the body of the stream * - * @param StreamInterface $stream Stream to cache + * @param StreamInterface $stream Stream to cache. The cursor is assumed to be at the beginning of the stream. * @param StreamInterface $target Optionally specify where data is cached */ public function __construct( @@ -29,7 +31,7 @@ class CachingStream implements StreamInterface StreamInterface $target = null ) { $this->remoteStream = $stream; - $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); } public function getSize() diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/DroppingStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/DroppingStream.php index e125642d3..9f7420c40 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface; /** * Stream decorator that begins dropping data once the size of the underlying * stream becomes too full. + * + * @final */ class DroppingStream implements StreamInterface { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/FnStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/FnStream.php index 407577a37..76a8cc7ba 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/FnStream.php @@ -9,6 +9,8 @@ use Psr\Http\Message\StreamInterface; * * Allows for easy testing and extension of a provided stream without needing * to create a concrete class for a simple extension point. + * + * @final */ class FnStream implements StreamInterface { @@ -56,6 +58,7 @@ class FnStream implements StreamInterface /** * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * * @throws \LogicException */ public function __wakeup() diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/InflateStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/InflateStream.php index c98b96f25..0cbd2cce2 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -14,6 +14,8 @@ use Psr\Http\Message\StreamInterface; * * @link http://tools.ietf.org/html/rfc1952 * @link http://php.net/manual/en/filters.compression.php + * + * @final */ class InflateStream implements StreamInterface { @@ -34,6 +36,7 @@ class InflateStream implements StreamInterface /** * @param StreamInterface $stream * @param $header + * * @return int */ private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 13c7af5c8..911e127d3 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface; /** * Lazily reads or writes to a file that is opened only after an IO operation * take place on the stream. + * + * @final */ class LazyOpenStream implements StreamInterface { @@ -15,7 +17,7 @@ class LazyOpenStream implements StreamInterface /** @var string File to open */ private $filename; - /** @var string $mode */ + /** @var string */ private $mode; /** diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/LimitStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/LimitStream.php index bef9161ea..1173ec40d 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/LimitStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -4,9 +4,10 @@ namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; - /** - * Decorator used to return only a subset of a stream + * Decorator used to return only a subset of a stream. + * + * @final */ class LimitStream implements StreamInterface { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/MultipartStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/MultipartStream.php index 0cbfea35d..5a6079a89 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface; /** * Stream that when read returns bytes for a streaming multipart or * multipart/form-data stream. + * + * @final */ class MultipartStream implements StreamInterface { @@ -115,9 +117,11 @@ class MultipartStream implements StreamInterface $disposition = $this->getHeader($headers, 'content-disposition'); if (!$disposition) { $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf('form-data; name="%s"; filename="%s"', + ? sprintf( + 'form-data; name="%s"; filename="%s"', $name, - basename($filename)) + basename($filename) + ) : "form-data; name=\"{$name}\""; } diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/NoSeekStream.php index 4b04b4c0a..d66bdde46 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -5,7 +5,9 @@ namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; /** - * Stream decorator that prevents a stream from being seeked + * Stream decorator that prevents a stream from being seeked. + * + * @final */ class NoSeekStream implements StreamInterface { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/PumpStream.php b/e107_handlers/vendor/guzzlehttp/psr7/src/PumpStream.php index fbd8726b4..44c7b582c 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/PumpStream.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/PumpStream.php @@ -13,6 +13,8 @@ use Psr\Http\Message\StreamInterface; * returned by the provided callable is buffered internally until drained using * the read() function of the PumpStream. The provided callable MUST return * false when there is no more data to read. + * + * @final */ class PumpStream implements StreamInterface { @@ -32,14 +34,14 @@ class PumpStream implements StreamInterface private $buffer; /** - * @param callable $source Source of the stream data. The callable MAY - * accept an integer argument used to control the - * amount of data to return. The callable MUST - * return a string when called, or false on error - * or EOF. - * @param array $options Stream options: - * - metadata: Hash of metadata to use with stream. - * - size: Size of the stream, if known. + * @param callable $source Source of the stream data. The callable MAY + * accept an integer argument used to control the + * amount of data to return. The callable MUST + * return a string when called, or false on error + * or EOF. + * @param array $options Stream options: + * - metadata: Hash of metadata to use with stream. + * - size: Size of the stream, if known. */ public function __construct(callable $source, array $options = []) { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Query.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Query.php index 99e093050..5a7cc0359 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Query.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Query.php @@ -34,7 +34,9 @@ final class Query } elseif ($urlEncoding === PHP_QUERY_RFC1738) { $decoder = 'urldecode'; } else { - $decoder = function ($str) { return $str; }; + $decoder = function ($str) { + return $str; + }; } foreach (explode('&', $str) as $kvp) { @@ -65,6 +67,7 @@ final class Query * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 * to encode using RFC3986, or PHP_QUERY_RFC1738 * to encode using RFC1738. + * * @return string */ public static function build(array $params, $encoding = PHP_QUERY_RFC3986) @@ -74,7 +77,9 @@ final class Query } if ($encoding === false) { - $encoder = function ($str) { return $str; }; + $encoder = function ($str) { + return $str; + }; } elseif ($encoding === PHP_QUERY_RFC3986) { $encoder = 'rawurlencode'; } elseif ($encoding === PHP_QUERY_RFC1738) { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Request.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Request.php index 89fbb1e62..c1cdaebff 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Request.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Request.php @@ -17,7 +17,7 @@ class Request implements RequestInterface /** @var string */ private $method; - /** @var null|string */ + /** @var string|null */ private $requestTarget; /** @var UriInterface */ @@ -27,7 +27,7 @@ class Request implements RequestInterface * @param string $method HTTP method * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|null|resource|StreamInterface $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version */ public function __construct( diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Response.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Response.php index 36b85fb78..8c01a0f5a 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Response.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Response.php @@ -83,7 +83,7 @@ class Response implements ResponseInterface /** * @param int $status Status code * @param array $headers Response headers - * @param string|null|resource|StreamInterface $body Response body + * @param string|resource|StreamInterface|null $body Response body * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Rfc7230.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Rfc7230.php index 505e4742b..51b571f24 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -11,6 +11,7 @@ final class Rfc7230 * Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons. * * @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 + * * @license https://github.com/amphp/http/blob/v1.0.1/LICENSE */ const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/ServerRequest.php b/e107_handlers/vendor/guzzlehttp/psr7/src/ServerRequest.php index 72c5566cf..e6d26f5ff 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -4,9 +4,9 @@ namespace GuzzleHttp\Psr7; use InvalidArgumentException; use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\UriInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +use Psr\Http\Message\UriInterface; /** * Server-side HTTP request @@ -35,7 +35,7 @@ class ServerRequest extends Request implements ServerRequestInterface private $cookieParams = []; /** - * @var null|array|object + * @var array|object|null */ private $parsedBody; @@ -58,7 +58,7 @@ class ServerRequest extends Request implements ServerRequestInterface * @param string $method HTTP method * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|null|resource|StreamInterface $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version * @param array $serverParams Typically the $_SERVER superglobal */ @@ -111,6 +111,7 @@ class ServerRequest extends Request implements ServerRequestInterface * delegate to normalizeNestedFileSpec() and return that return value. * * @param array $value $_FILES struct + * * @return array|UploadedFileInterface */ private static function createUploadedFileFromSpec(array $value) @@ -135,6 +136,7 @@ class ServerRequest extends Request implements ServerRequestInterface * UploadedFileInterface instances. * * @param array $files + * * @return UploadedFileInterface[] */ private static function normalizeNestedFileSpec(array $files = []) @@ -184,7 +186,7 @@ class ServerRequest extends Request implements ServerRequestInterface private static function extractHostAndPortFromAuthority($authority) { - $uri = 'http://'.$authority; + $uri = 'http://' . $authority; $parts = parse_url($uri); if (false === $parts) { return [null, null]; @@ -245,7 +247,6 @@ class ServerRequest extends Request implements ServerRequestInterface return $uri; } - /** * {@inheritdoc} */ diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/e107_handlers/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 093023b1c..5025dd67b 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -6,6 +6,7 @@ use Psr\Http\Message\StreamInterface; /** * Stream decorator trait + * * @property StreamInterface stream */ trait StreamDecoratorTrait diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/e107_handlers/vendor/guzzlehttp/psr7/src/StreamWrapper.php index eac653539..fc7cb969b 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -6,6 +6,8 @@ use Psr\Http\Message\StreamInterface; /** * Converts Guzzle streams into PHP stream resources. + * + * @final */ class StreamWrapper { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/UploadedFile.php b/e107_handlers/vendor/guzzlehttp/psr7/src/UploadedFile.php index a0ea59e09..bf342c4de 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -39,7 +39,7 @@ class UploadedFile implements UploadedFileInterface private $error; /** - * @var null|string + * @var string|null */ private $file; @@ -60,10 +60,10 @@ class UploadedFile implements UploadedFileInterface /** * @param StreamInterface|string|resource $streamOrFile - * @param int $size - * @param int $errorStatus - * @param string|null $clientFilename - * @param string|null $clientMediaType + * @param int $size + * @param int $errorStatus + * @param string|null $clientFilename + * @param string|null $clientMediaType */ public function __construct( $streamOrFile, @@ -144,7 +144,8 @@ class UploadedFile implements UploadedFileInterface /** * @param mixed $param - * @return boolean + * + * @return bool */ private function isStringOrNull($param) { @@ -153,7 +154,8 @@ class UploadedFile implements UploadedFileInterface /** * @param mixed $param - * @return boolean + * + * @return bool */ private function isStringNotEmpty($param) { @@ -195,7 +197,7 @@ class UploadedFile implements UploadedFileInterface /** * Return true if there is no upload error * - * @return boolean + * @return bool */ private function isOk() { @@ -203,7 +205,7 @@ class UploadedFile implements UploadedFileInterface } /** - * @return boolean + * @return bool */ public function isMoved() { @@ -248,10 +250,10 @@ class UploadedFile implements UploadedFileInterface * * @param string $targetPath Path to which to move the uploaded file. * - * @throws RuntimeException if the upload was not successful. + * @throws RuntimeException if the upload was not successful. * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. */ public function moveTo($targetPath) { @@ -297,6 +299,7 @@ class UploadedFile implements UploadedFileInterface * {@inheritdoc} * * @see http://php.net/manual/en/features.file-upload.errors.php + * * @return int One of PHP's UPLOAD_ERR_XXX constants. */ public function getError() @@ -308,7 +311,7 @@ class UploadedFile implements UploadedFileInterface * {@inheritdoc} * * @return string|null The filename sent by the client or null if none - * was provided. + * was provided. */ public function getClientFilename() { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Uri.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Uri.php index a0d73917e..ab201c1d1 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Uri.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Uri.php @@ -67,7 +67,7 @@ class Uri implements UriInterface { // weak type check to also accept null until we can add scalar type hints if ($uri != '') { - $parts = parse_url($uri); + $parts = self::parse($uri); if ($parts === false) { throw new \InvalidArgumentException("Unable to parse URI: $uri"); } @@ -75,6 +75,49 @@ class Uri implements UriInterface } } + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @param string $url + * + * @return array|false + */ + private static function parse($url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + $prefix = $matches[1]; + $url = $matches[2]; + } + + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix.$encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + public function __toString() { return self::composeComponents( @@ -167,6 +210,7 @@ class Uri implements UriInterface * @param UriInterface $uri * * @return bool + * * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference @@ -185,6 +229,7 @@ class Uri implements UriInterface * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri) @@ -200,6 +245,7 @@ class Uri implements UriInterface * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri) @@ -218,6 +264,7 @@ class Uri implements UriInterface * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri) @@ -238,6 +285,7 @@ class Uri implements UriInterface * @param UriInterface|null $base An optional base URI to compare against * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) @@ -358,6 +406,7 @@ class Uri implements UriInterface * @param array $parts * * @return UriInterface + * * @link http://php.net/manual/en/function.parse-url.php * * @throws \InvalidArgumentException If the components do not form a valid URI. @@ -576,7 +625,7 @@ class Uri implements UriInterface throw new \InvalidArgumentException('Scheme must be a string'); } - return strtolower($scheme); + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); } /** @@ -612,7 +661,7 @@ class Uri implements UriInterface throw new \InvalidArgumentException('Host must be a string'); } - return strtolower($host); + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); } /** @@ -641,7 +690,7 @@ class Uri implements UriInterface /** * @param UriInterface $uri * @param array $keys - * + * * @return array */ private static function getFilteredQueryString(UriInterface $uri, array $keys) @@ -662,7 +711,7 @@ class Uri implements UriInterface /** * @param string $key * @param string|null $value - * + * * @return string */ private static function generateQueryString($key, $value) @@ -754,7 +803,7 @@ class Uri implements UriInterface 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', E_USER_DEPRECATED ); - $this->path = '/'. $this->path; + $this->path = '/' . $this->path; //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); } } diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/e107_handlers/vendor/guzzlehttp/psr7/src/UriNormalizer.php index 2b9174a5e..81419ead4 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -115,6 +115,7 @@ final class UriNormalizer * @param int $flags A bitmask of normalizations to apply, see constants * * @return UriInterface The normalized URI + * * @link https://tools.ietf.org/html/rfc3986#section-6.2 */ public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS) @@ -171,6 +172,7 @@ final class UriNormalizer * @param int $normalizations A bitmask of normalizations to apply, see constants * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-6.1 */ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/UriResolver.php b/e107_handlers/vendor/guzzlehttp/psr7/src/UriResolver.php index 26cecd53a..a3cb15d57 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -19,6 +19,7 @@ final class UriResolver * @param string $path * * @return string + * * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 */ public static function removeDotSegments($path) @@ -58,6 +59,7 @@ final class UriResolver * @param UriInterface $rel Relative URI * * @return UriInterface + * * @link http://tools.ietf.org/html/rfc3986#section-5.2 */ public static function resolve(UriInterface $base, UriInterface $rel) diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/Utils.php b/e107_handlers/vendor/guzzlehttp/psr7/src/Utils.php index 86960dde2..7c7cc3eb6 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/Utils.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/Utils.php @@ -75,6 +75,7 @@ final class Utils * @param StreamInterface $stream Stream to read * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. + * * @return string * * @throws \RuntimeException on error. @@ -181,7 +182,7 @@ final class Utils $standardPorts = ['http' => 80, 'https' => 443]; $scheme = $changes['uri']->getScheme(); if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':'.$port; + $changes['set_headers']['Host'] .= ':' . $port; } } } @@ -202,7 +203,7 @@ final class Utils } if ($request instanceof ServerRequestInterface) { - return (new ServerRequest( + $new = (new ServerRequest( isset($changes['method']) ? $changes['method'] : $request->getMethod(), $uri, $headers, @@ -216,6 +217,12 @@ final class Utils ->withQueryParams($request->getQueryParams()) ->withCookieParams($request->getCookieParams()) ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; } return new Request( @@ -286,7 +293,7 @@ final class Utils * number of requested bytes are available. Any additional bytes will be * buffered and used in subsequent reads. * - * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data * @param array $options Additional options * * @return StreamInterface @@ -296,7 +303,7 @@ final class Utils public static function streamFor($resource = '', array $options = []) { if (is_scalar($resource)) { - $stream = fopen('php://temp', 'r+'); + $stream = self::tryFopen('php://temp', 'r+'); if ($resource !== '') { fwrite($stream, $resource); fseek($stream, 0); @@ -306,6 +313,16 @@ final class Utils switch (gettype($resource)) { case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + if (\stream_get_meta_data($resource)['uri'] === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } return new Stream($resource, $options); case 'object': if ($resource instanceof StreamInterface) { @@ -324,7 +341,7 @@ final class Utils } break; case 'NULL': - return new Stream(fopen('php://temp', 'r+'), $options); + return new Stream(self::tryFopen('php://temp', 'r+'), $options); } if (is_callable($resource)) { @@ -352,14 +369,26 @@ final class Utils $ex = null; set_error_handler(function () use ($filename, $mode, &$ex) { $ex = new \RuntimeException(sprintf( - 'Unable to open %s using mode %s: %s', + 'Unable to open "%s" using mode "%s": %s', $filename, $mode, func_get_args()[1] )); + + return true; }); - $handle = fopen($filename, $mode); + try { + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + restore_error_handler(); if ($ex) { diff --git a/e107_handlers/vendor/guzzlehttp/psr7/src/functions.php b/e107_handlers/vendor/guzzlehttp/psr7/src/functions.php index e4cc13619..b0901fadd 100644 --- a/e107_handlers/vendor/guzzlehttp/psr7/src/functions.php +++ b/e107_handlers/vendor/guzzlehttp/psr7/src/functions.php @@ -70,7 +70,7 @@ function uri_for($uri) * number of requested bytes are available. Any additional bytes will be * buffered and used in subsequent reads. * - * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data * @param array $options Additional options * * @return StreamInterface @@ -187,6 +187,7 @@ function try_fopen($filename, $mode) * @param StreamInterface $stream Stream to read * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. + * * @return string * * @throws \RuntimeException on error. @@ -311,6 +312,7 @@ function parse_query($str, $urlEncoding = true) * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 * to encode using RFC3986, or PHP_QUERY_RFC1738 * to encode using RFC1738. + * * @return string * * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. @@ -361,6 +363,7 @@ function mimetype_from_extension($extension) * @return array * * @internal + * * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. */ function _parse_message($message) @@ -377,6 +380,7 @@ function _parse_message($message) * @return string * * @internal + * * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. */ function _parse_request_uri($path, array $headers) @@ -409,6 +413,7 @@ function get_message_body_summary(MessageInterface $message, $truncateAt = 120) * @return array * * @internal + * * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. */ function _caseless_remove($keys, array $data) diff --git a/e107_handlers/vendor/hybridauth/hybridauth/README.md b/e107_handlers/vendor/hybridauth/hybridauth/README.md index dfa7f403e..6ad53b2f5 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/README.md +++ b/e107_handlers/vendor/hybridauth/hybridauth/README.md @@ -1,4 +1,4 @@ -## [Hybridauth](https://hybridauth.github.io/) 3.5 +## [Hybridauth](https://hybridauth.github.io/) 3.7.1 [![Build Status](https://travis-ci.org/hybridauth/hybridauth.svg?branch=master)](https://travis-ci.org/hybridauth/hybridauth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hybridauth/hybridauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [![Latest Stable Version](https://poser.pugx.org/hybridauth/hybridauth/v/stable.png)](https://packagist.org/packages/hybridauth/hybridauth) [![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php index 0066d8496..4d828203d 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php @@ -136,6 +136,14 @@ abstract class AbstractAdapter implements AdapterInterface throw new NotImplementedException('Provider does not support this feature.'); } + /** + * {@inheritdoc} + */ + public function maintainToken() + { + // Nothing needed for most providers + } + /** * {@inheritdoc} */ diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php index c2577d288..537daaa32 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php @@ -97,6 +97,12 @@ interface AdapterInterface */ public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false); + /** + * Do whatever may be necessary to make sure tokens do not expire. + * Intended to be be called frequently, e.g. via Cron. + */ + public function maintainToken(); + /** * Return oauth access tokens. * diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php index c59005cb1..e500d1a23 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php @@ -544,6 +544,9 @@ abstract class OAuth1 extends AbstractAdapter implements AdapterInterface */ public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) { + // refresh tokens if needed + $this->maintainToken(); + if (strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0) { $url = rtrim($this->apiBaseUrl, '/') . '/' . ltrim($url, '/'); } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php index a321a7f9b..06d495d92 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php @@ -710,6 +710,7 @@ abstract class OAuth2 extends AbstractAdapter implements AdapterInterface public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) { // refresh tokens if needed + $this->maintainToken(); if ($this->hasAccessTokenExpired() === true) { $this->refreshAccessToken(); } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php index 35956d6f1..f1c0e9d0f 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php @@ -9,7 +9,6 @@ namespace Hybridauth\Adapter; use Hybridauth\Exception\InvalidOpenidIdentifierException; use Hybridauth\Exception\AuthorizationDeniedException; -use Hybridauth\Exception\InvalidOpenidResponseException; use Hybridauth\Exception\UnexpectedApiResponseException; use Hybridauth\Data; use Hybridauth\HttpClient; @@ -38,6 +37,15 @@ abstract class OpenID extends AbstractAdapter implements AdapterInterface */ protected $openidIdentifier = ''; + /** + * IPD API Documentation + * + * OPTIONAL. + * + * @var string + */ + protected $apiDocumentation = ''; + /** * {@inheritdoc} */ diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Data/Parser.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Data/Parser.php index 46939e36d..4259780b8 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Data/Parser.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Data/Parser.php @@ -63,7 +63,7 @@ final class Parser { libxml_use_internal_errors(true); - $result = preg_replace('/([<<\/])([a-z0-9-]+):/i', '$1', $result); + $result = preg_replace('/([<\/])([a-z0-9-]+):/i', '$1', $result); $xml = simplexml_load_string($result); libxml_use_internal_errors(false); diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Curl.php b/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Curl.php index e150d2d6b..512eabc95 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Curl.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Curl.php @@ -176,7 +176,9 @@ class Curl implements HttpClientInterface } /** - * {@inheritdoc} + * Get response details + * + * @return array Map structure of details */ public function getResponse() { diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php b/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php index 758b96e70..9ff0303eb 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php @@ -190,7 +190,9 @@ class Guzzle implements HttpClientInterface } /** - * {@inheritdoc} + * Get response details + * + * @return array Map structure of details */ public function getResponse() { diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php index 7391c8cf1..2af1785ea 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php @@ -7,12 +7,12 @@ namespace Hybridauth\Provider; -use Hybridauth\Adapter\OpenID as OpenIDAdapter; +use Hybridauth\Adapter\OpenID; /** * AOL OpenID provider adapter. */ -class AOLOpenID extends OpenIDAdapter +class AOLOpenID extends OpenID { /** * {@inheritdoc} diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php index 685c044cc..68aeeb013 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php @@ -8,7 +8,7 @@ namespace Hybridauth\Provider; use Hybridauth\Adapter\OAuth2; -use Hybridauth\Exception\UnexpectedValueException; +use Hybridauth\Exception\UnexpectedApiResponseException; use Hybridauth\Data; use Hybridauth\User; diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Facebook.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Facebook.php index 62dbac48f..584e5ad79 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Facebook.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Facebook.php @@ -92,8 +92,12 @@ class Facebook extends OAuth2 /** * {@inheritdoc} */ - public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + public function maintainToken() { + if (!$this->isConnected()) { + return; + } + // Handle token exchange prior to the standard handler for an API request $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; if ($exchange_by_expiry_days !== null) { @@ -102,8 +106,6 @@ class Facebook extends OAuth2 $this->exchangeAccessToken(); } } - - return parent::apiRequest($url, $method, $parameters, $headers, $multipart); } /** @@ -112,7 +114,7 @@ class Facebook extends OAuth2 * @return string Raw Provider API response * @throws \Hybridauth\Exception\HttpClientFailureException * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException + * @throws \Hybridauth\Exception\InvalidAccessTokenException */ public function exchangeAccessToken() { diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Instagram.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Instagram.php index 6c0cf691c..1f32e7bc9 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Instagram.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Instagram.php @@ -55,6 +55,92 @@ class Instagram extends OAuth2 $this->apiRequestParameters[$this->accessTokenName] = $accessToken; } + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $collection = parent::validateAccessTokenExchange($response); + + if (!$collection->exists('expires_in')) { + // Instagram tokens always expire in an hour, but this is implicit not explicit + + $expires_in = 60 * 60; + + $expires_at = time() + $expires_in; + + $this->storeData('expires_in', $expires_in); + $this->storeData('expires_at', $expires_at); + } + + return $collection; + } + + /** + * {@inheritdoc} + */ + public function maintainToken() + { + if (!$this->isConnected()) { + return; + } + + // Handle token exchange prior to the standard handler for an API request + $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; + if ($exchange_by_expiry_days !== null) { + $projected_timestamp = time() + 60 * 60 * 24 * $exchange_by_expiry_days; + if (!$this->hasAccessTokenExpired() && $this->hasAccessTokenExpired($projected_timestamp)) { + $this->exchangeAccessToken(); + } + } + } + + /** + * Exchange the Access Token with one that expires further in the future. + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + */ + public function exchangeAccessToken() + { + if ($this->getStoredData('expires_in') >= 5000000) { + /* + Refresh a long-lived token (needed on Instagram, but not Facebook). + It's not an oAuth style refresh using a refresh token. + Actually it's really just another exchange, and invalidates the old token. + Facebook/Instagram documentation is not very helpful at explaining that! + */ + $exchangeTokenParameters = [ + 'grant_type' => 'ig_refresh_token', + 'client_secret' => $this->clientSecret, + 'access_token' => $this->getStoredData('access_token'), + ]; + $url = 'https://graph.instagram.com/refresh_access_token'; + } else { + // Exchange short-lived to long-lived + $exchangeTokenParameters = [ + 'grant_type' => 'ig_exchange_token', + 'client_secret' => $this->clientSecret, + 'access_token' => $this->getStoredData('access_token'), + ]; + $url = 'https://graph.instagram.com/access_token'; + } + + $response = $this->httpClient->request( + $url, + 'GET', + $exchangeTokenParameters + ); + + $this->validateApiResponse('Unable to exchange the access token'); + + $this->validateAccessTokenExchange($response); + + return $response; + } + /** * {@inheritdoc} */ diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php index f8e949095..074fff0a3 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php @@ -145,8 +145,9 @@ class MicrosoftGraph extends OAuth2 $userContact = new User\Contact(); $userContact->identifier = $entry->get('id'); $userContact->displayName = $entry->get('displayName'); - if (!empty($entry->get('emailAddresses'))) { - $userContact->email = $entry->get('emailAddresses')[0]->address; + $emailAddresses = $entry->get('emailAddresses'); + if (!empty($emailAddresses)) { + $userContact->email = $emailAddresses[0]->address; } // only add to collection if we have usefull data if (!empty($userContact->displayName) || !empty($userContact->email)) { diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/OpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/OpenID.php index 60ffb609f..d58a30d49 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/OpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/OpenID.php @@ -7,7 +7,7 @@ namespace Hybridauth\Provider; -use Hybridauth\Adapter\OpenID as OpenIDAdapter; +use Hybridauth\Adapter; /** * Generic OpenID providers adapter. @@ -39,6 +39,6 @@ use Hybridauth\Adapter\OpenID as OpenIDAdapter; * echo $e->getMessage() ; * } */ -class OpenID extends OpenIDAdapter +class OpenID extends Adapter\OpenID { } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Patreon.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Patreon.php index e17411f64..83ff612fa 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Patreon.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Patreon.php @@ -9,6 +9,7 @@ namespace Hybridauth\Provider; use Hybridauth\Adapter\OAuth2; use Hybridauth\Exception\UnexpectedApiResponseException; +use Hybridauth\User; use Hybridauth\User\Profile; use Hybridauth\Data\Collection; @@ -88,4 +89,106 @@ class Patreon extends OAuth2 return $userProfile; } + + /** + * Contacts are defined as Patrons here + */ + public function getUserContacts() + { + $campaignId = $this->config->get('campaign_id') ?: null; + $tierFilter = $this->config->get('tier_filter') ?: null; + + $campaigns = []; + if ($campaignId === null) { + $campaignsUrl = 'oauth2/v2/campaigns'; + do { + $response = $this->apiRequest($campaignsUrl); + $data = new Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + foreach ($data->filter('data')->toArray() as $item) { + $campaign = new Collection($item); + $campaigns[] = $campaign->get('id'); + } + + if ($data->filter('links')->exists('next')) { + $campaignsUrl = $data->filter('links')->get('next'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + } else { + $campaigns[] = $campaignId; + } + + $contacts = []; + + foreach ($campaigns as $campaignId) { + $params = [ + 'include' => 'currently_entitled_tiers', + 'fields[member]' => 'full_name,patron_status,email', + 'fields[tier]' => 'title', + ]; + $membersUrl = 'oauth2/v2/campaigns/' . $campaignId . '/members?' . http_build_query($params); + + do { + $response = $this->apiRequest($membersUrl); + + $data = new Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $tierTitles = []; + + foreach ($data->filter('included')->toArray() as $item) { + $includedItem = new Collection($item); + if ($includedItem->get('type') == 'tier') { + $tierTitles[$includedItem->get('id')] = $includedItem->filter('attributes')->get('title'); + } + } + + foreach ($data->filter('data')->toArray() as $item) { + $member = new Collection($item); + + if ($member->filter('attributes')->get('patron_status') == 'active_patron') { + $tiers = []; + $tierObs = $member->filter('relationships')->filter('currently_entitled_tiers')->get('data'); + foreach ($tierObs as $item) { + $tier = new Collection($item); + $tierId = $tier->get('id'); + $tiers[] = $tierTitles[$tierId]; + } + + if (($tierFilter === null) || (in_array($tierFilter, $tiers))) { + $userContact = new User\Contact(); + + $userContact->identifier = $member->get('id'); + $userContact->email = $member->filter('attributes')->get('email'); + $userContact->displayName = $member->filter('attributes')->get('full_name'); + $userContact->description = json_encode($tiers); + + $contacts[] = $userContact; + } + } + } + + if ($data->filter('links')->exists('next')) { + $membersUrl = $data->filter('links')->get('next'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + } + + return $contacts; + } } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php index a964ea863..9c455f82e 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php @@ -7,13 +7,13 @@ namespace Hybridauth\Provider; -use Hybridauth\Adapter\OpenID as OpenIDAdapter; +use Hybridauth\Adapter\OpenID; use Hybridauth\HttpClient; /** * PayPal OpenID provider adapter. */ -class PaypalOpenID extends OpenIDAdapter +class PaypalOpenID extends OpenID { /** * {@inheritdoc} diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php index fa63b4f19..4e8d5763e 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php @@ -7,12 +7,12 @@ namespace Hybridauth\Provider; -use Hybridauth\Adapter\OpenID as OpenIDAdapter; +use Hybridauth\Adapter\OpenID; /** * StackExchange OpenID provider adapter. */ -class StackExchangeOpenID extends OpenIDAdapter +class StackExchangeOpenID extends OpenID { /** * {@inheritdoc} diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Steam.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Steam.php index d041adb18..1288f0a74 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Steam.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Steam.php @@ -7,7 +7,7 @@ namespace Hybridauth\Provider; -use Hybridauth\Adapter\OpenID as OpenIDAdapter; +use Hybridauth\Adapter\OpenID; use Hybridauth\Exception\UnexpectedApiResponseException; use Hybridauth\Data; use Hybridauth\User; @@ -32,7 +32,7 @@ use Hybridauth\User; * echo $e->getMessage() ; * } */ -class Steam extends OpenIDAdapter +class Steam extends OpenID { /** * {@inheritdoc} diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Telegram.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Telegram.php index 28d3d0908..059f34dba 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Telegram.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Telegram.php @@ -51,7 +51,11 @@ class Telegram extends AbstractAdapter implements AdapterInterface protected $callbackUrl = ''; /** - * {@inheritdoc} + * IPD API Documentation + * + * OPTIONAL. + * + * @var string */ protected $apiDocumentation = 'https://core.telegram.org/bots'; @@ -98,7 +102,8 @@ class Telegram extends AbstractAdapter implements AdapterInterface */ public function isConnected() { - return !empty($this->getStoredData('auth_data')); + $authData = $this->getStoredData('auth_data'); + return !empty($authData); } /** diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/WeChat.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/WeChat.php index eac67682a..7fcd3a5ca 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/WeChat.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/WeChat.php @@ -127,7 +127,8 @@ class WeChat extends OAuth2 $userProfile->city = $data->get('city'); $userProfile->region = $data->get('province'); $userProfile->country = $data->get('country'); - $userProfile->gender = ['', 'male', 'female'][(int)$data->get('sex')]; + $genders = ['', 'male', 'female']; + $userProfile->gender = $genders[(int)$data->get('sex')]; return $userProfile; } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Yandex.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Yandex.php index 5710b35b0..ef3632543 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Yandex.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Provider/Yandex.php @@ -10,8 +10,8 @@ namespace Hybridauth\Provider; use Hybridauth\Adapter\OAuth2; use Hybridauth\Exception\Exception; use Hybridauth\Exception\UnexpectedApiResponseException; -use Hybridauth\Data\Collection; -use Hybridauth\User\Profile; +use Hybridauth\Data; +use Hybridauth\User; /** * Yandex OAuth2 provider adapter. @@ -36,10 +36,11 @@ class Yandex extends OAuth2 /** * {@inheritdoc} */ - protected $apiDocumentation = 'https://yandex.com/dev/oauth/doc/dg/concepts/about-docpage/'; + protected $apiDocumentation + = 'https://yandex.com/dev/oauth/doc/dg/concepts/about-docpage/'; /** - * load the user profile from the IDp api client + * Load the user profile from the IDp api client * * @throws Exception */ @@ -53,26 +54,27 @@ class Yandex extends OAuth2 throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } - $data = new Collection($response); + $data = new Data\Collection($response); if (!$data->exists('id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } - $userProfile = new Profile(); - + $userProfile = new User\Profile(); $userProfile->identifier = $data->get('id'); - $userProfile->firstName = $data->get('real_name'); - $userProfile->lastName = $data->get('family_name'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); $userProfile->displayName = $data->get('display_name'); - $userProfile->photoURL = 'http://upics.yandex.net/' . $userProfile->identifier . '/normal'; - $userProfile->profileURL = ""; + $userProfile->photoURL + = 'https://avatars.yandex.net/get-yapic/' . + $data->get('default_avatar_id') . '/islands-200'; $userProfile->gender = $data->get('sex'); $userProfile->email = $data->get('default_email'); $userProfile->emailVerified = $data->get('default_email'); if ($data->get('birthday')) { - list($birthday_year, $birthday_month, $birthday_day) = explode('-', $response->birthday); + list($birthday_year, $birthday_month, $birthday_day) + = explode('-', $response->birthday); $userProfile->birthDay = (int)$birthday_day; $userProfile->birthMonth = (int)$birthday_month; $userProfile->birthYear = (int)$birthday_year; diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php index 77b5011b4..b13541d00 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php @@ -165,15 +165,22 @@ class OAuthRequest */ public function get_signable_parameters() { - // Grab all parameters - $params = $this->parameters; - + $params = []; + + // Grab all parameters. + foreach ($this->parameters as $key_param => $value_param) { + // Process only scalar values. + if (is_scalar($value_param)) { + $params[$key_param] = $value_param; + } + } + // Remove oauth_signature if present // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") if (isset($params['oauth_signature'])) { unset($params['oauth_signature']); } - + return OAuthUtil::build_http_query($params); } diff --git a/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php b/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php index 6012754f7..14deab36a 100644 --- a/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php +++ b/e107_handlers/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php @@ -274,7 +274,7 @@ class LightOpenID * @return array|bool|string * @throws ErrorException */ - protected function request_curl($url, $method='GET', $params=array(), $update_claimed_id) + protected function request_curl($url, $method='GET', $params=array(), $update_claimed_id=false) { $params = http_build_query($params, '', '&'); $curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : '')); @@ -419,7 +419,7 @@ class LightOpenID * @return array|false|string * @throws ErrorException */ - protected function request_streams($url, $method='GET', $params=array(), $update_claimed_id) + protected function request_streams($url, $method='GET', $params=array(), $update_claimed_id=false) { if (!$this->hostExists($url)) { throw new ErrorException("Could not connect to $url.", 404); diff --git a/e107_handlers/vendor/matthiasmullie/minify/Dockerfile b/e107_handlers/vendor/matthiasmullie/minify/Dockerfile index fc36a814e..5917e05f4 100644 --- a/e107_handlers/vendor/matthiasmullie/minify/Dockerfile +++ b/e107_handlers/vendor/matthiasmullie/minify/Dockerfile @@ -5,8 +5,8 @@ COPY . /var/www WORKDIR /var/www RUN apt-get update -RUN apt-get install -y zip unzip zlib1g-dev -RUN if [[ `php-config --vernum` -ge 73000 ]]; then docker-php-ext-install zip; fi +RUN apt-get install -y zip unzip libzip-dev git +RUN docker-php-ext-install zip RUN docker-php-ext-install pcntl RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer diff --git a/e107_handlers/vendor/matthiasmullie/minify/composer.json b/e107_handlers/vendor/matthiasmullie/minify/composer.json index 6d81b4f9d..a6dd4ab6a 100644 --- a/e107_handlers/vendor/matthiasmullie/minify/composer.json +++ b/e107_handlers/vendor/matthiasmullie/minify/composer.json @@ -19,8 +19,8 @@ "matthiasmullie/path-converter": "~1.1" }, "require-dev": { - "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8", + "matthiasmullie/scrapbook": "dev-master", + "phpunit/phpunit": ">=4.8", "friendsofphp/php-cs-fixer": "~2.0" }, "suggest": { diff --git a/e107_handlers/vendor/matthiasmullie/minify/src/CSS.php b/e107_handlers/vendor/matthiasmullie/minify/src/CSS.php index ea8e8cd93..eb98e52ed 100644 --- a/e107_handlers/vendor/matthiasmullie/minify/src/CSS.php +++ b/e107_handlers/vendor/matthiasmullie/minify/src/CSS.php @@ -685,7 +685,7 @@ class CSS extends Minify protected function extractMath() { $functions = array('calc', 'clamp', 'min', 'max'); - $pattern = '/('. implode('|', $functions) .')(\(.+?)(?=$|;|})/m'; + $pattern = '/\b('. implode('|', $functions) .')(\(.+?)(?=$|;|})/m'; // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; diff --git a/e107_handlers/vendor/matthiasmullie/minify/src/JS.php b/e107_handlers/vendor/matthiasmullie/minify/src/JS.php index 92389cdd5..a0fa649d3 100644 --- a/e107_handlers/vendor/matthiasmullie/minify/src/JS.php +++ b/e107_handlers/vendor/matthiasmullie/minify/src/JS.php @@ -254,7 +254,7 @@ class JS extends Minify // of the RegExp methods (a `\` followed by a variable or value is // likely part of a division, not a regex) $keywords = array('do', 'in', 'new', 'else', 'throw', 'yield', 'delete', 'return', 'typeof'); - $before = '([=:,;\+\-\*\/\}\(\{\[&\|!]|^|'.implode('|', $keywords).')\s*'; + $before = '(^|[=:,;\+\-\*\/\}\(\{\[&\|!]|'.implode('|', $keywords).')\s*'; $propertiesAndMethods = array( // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Properties_2 'constructor', diff --git a/e107_handlers/vendor/matthiasmullie/minify/src/Minify.php b/e107_handlers/vendor/matthiasmullie/minify/src/Minify.php index 3f40bc157..4d8dcf40e 100644 --- a/e107_handlers/vendor/matthiasmullie/minify/src/Minify.php +++ b/e107_handlers/vendor/matthiasmullie/minify/src/Minify.php @@ -105,7 +105,7 @@ abstract class Minify * @param string|string[] $data * * @return static - * + * * @throws IOException */ public function addFile($data /* $data = null, ... */) @@ -472,7 +472,7 @@ abstract class Minify */ protected function openFileForWriting($path) { - if (($handler = @fopen($path, 'w')) === false) { + if ($path === '' || ($handler = @fopen($path, 'w')) === false) { throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.'); } @@ -490,7 +490,11 @@ abstract class Minify */ protected function writeToFile($handler, $content, $path = '') { - if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) { + if ( + !is_resource($handler) || + ($result = @fwrite($handler, $content)) === false || + ($result < strlen($content)) + ) { throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.'); } } diff --git a/e107_handlers/vendor/phpmailer/phpmailer/README.md b/e107_handlers/vendor/phpmailer/phpmailer/README.md index d9cbbaaf9..fa27d2f68 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/README.md +++ b/e107_handlers/vendor/phpmailer/phpmailer/README.md @@ -1,46 +1,45 @@ ![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) -[![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/) +[![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/) -[![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/) - -## Class Features +## Features - 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 -- 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 - Multipart/alternative emails for mail clients that do not read HTML email - Add attachments, including inline - 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 -- Protect against header injection attacks +- Protects against header injection attacks - Error messages in over 50 languages! - 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 - Much more! ## 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! -*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. +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! -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 -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 PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "~6.1" +"phpmailer/phpmailer": "^6.2" ``` 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`. -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 SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output - $mail->isSMTP(); // Send using SMTP - $mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through - $mail->SMTPAuth = true; // Enable SMTP authentication - $mail->Username = 'user@example.com'; // SMTP username - $mail->Password = 'secret'; // SMTP password - $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged - $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'user@example.com'; //SMTP username + $mail->Password = 'secret'; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged + $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above //Recipients $mail->setFrom('from@example.com', 'Mailer'); - $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient - $mail->addAddress('ellen@example.com'); // Name is optional + $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient + $mail->addAddress('ellen@example.com'); //Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); - // Attachments - $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments - $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + //Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name - // Content - $mail->isHTML(true); // Set email format to HTML + //Content + $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; @@ -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. @@ -140,43 +138,43 @@ That's it. You should now be ready to use PHPMailer! PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: ```php -// To load the French version +//To load the French version $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 -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). -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). ## 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? ## Security Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately. -See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for details on security issues. +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). ## Contributing 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. -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: @@ -187,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. ## 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. -Smartmessages email marketing +Smartmessages.net privacy-first email marketing logo -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 See [changelog](changelog.md). ## History - 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. -- 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. -- 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? - Official successor to the SourceForge and Google Code projects. - Test suite. -- Continuous integration with Travis-CI. +- Continuous integration with Github Actions. - Composer support. - Public development. - Additional languages and language strings. diff --git a/e107_handlers/vendor/phpmailer/phpmailer/SECURITY.md b/e107_handlers/vendor/phpmailer/phpmailer/SECURITY.md index fc3e61c20..2552df8a3 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/SECURITY.md +++ b/e107_handlers/vendor/phpmailer/phpmailer/SECURITY.md @@ -1,6 +1,6 @@ # 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 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. diff --git a/e107_handlers/vendor/phpmailer/phpmailer/VERSION b/e107_handlers/vendor/phpmailer/phpmailer/VERSION index 4ac4fded4..c0be8a799 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/VERSION +++ b/e107_handlers/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.2.0 \ No newline at end of file +6.4.0 \ No newline at end of file diff --git a/e107_handlers/vendor/phpmailer/phpmailer/composer.json b/e107_handlers/vendor/phpmailer/phpmailer/composer.json index 7388bd98b..b8aa5cfcc 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/composer.json +++ b/e107_handlers/vendor/phpmailer/phpmailer/composer.json @@ -40,7 +40,7 @@ "yoast/phpunit-polyfills": "^0.2.0" }, "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", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", diff --git a/e107_handlers/vendor/phpmailer/phpmailer/get_oauth_token.php b/e107_handlers/vendor/phpmailer/phpmailer/get_oauth_token.php index 560d36458..befdc34a5 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -38,20 +38,20 @@ namespace PHPMailer\PHPMailer; * Plenty to choose from here: * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ */ -// @see https://github.com/thephpleague/oauth2-google +//@see https://github.com/thephpleague/oauth2-google use League\OAuth2\Client\Provider\Google; -// @see https://packagist.org/packages/hayageek/oauth2-yahoo +//@see https://packagist.org/packages/hayageek/oauth2-yahoo use Hayageek\OAuth2\Client\Provider\Yahoo; -// @see https://github.com/stevenmaguire/oauth2-microsoft +//@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; if (!isset($_GET['code']) && !isset($_GET['provider'])) { ?> -Select Provider:
-Google
-Yahoo
-Microsoft/Outlook/Hotmail/Live/Office365
+Select Provider:
+Google
+Yahoo
+Microsoft/Outlook/Hotmail/Live/Office365
getAuthorizationUrl($options); $_SESSION['oauth2state'] = $provider->getState(); header('Location: ' . $authUrl); exit; -// Check given state against previously stored one to mitigate CSRF attack + //Check given state against previously stored one to mitigate CSRF attack } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { unset($_SESSION['oauth2state']); unset($_SESSION['provider']); exit('Invalid state'); } else { unset($_SESSION['provider']); - // Try to get an access token (using the authorization code grant) + //Try to get an access token (using the authorization code grant) $token = $provider->getAccessToken( 'authorization_code', [ 'code' => $_GET['code'] ] ); - // Use this to interact with an API on the users behalf - // Use this to get a new access token if the old one expires + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires echo 'Refresh Token: ', $token->getRefreshToken(); } diff --git a/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php index 55bdd9c89..e770a1a26 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php @@ -16,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['instantiate'] = 'Nelze vytvořit instanci emailové funkce.'; $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['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ě: '; diff --git a/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php index a1cfb2889..028f5bc49 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php @@ -18,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['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; $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['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; diff --git a/e107_handlers/vendor/phpmailer/phpmailer/src/OAuth.php b/e107_handlers/vendor/phpmailer/phpmailer/src/OAuth.php index 07fde4c81..c93d0be1b 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/src/OAuth.php @@ -123,7 +123,7 @@ class OAuth */ public function getOauth64() { - // Get a new token if it's not available or has expired + //Get a new token if it's not available or has expired if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { $this->oauthToken = $this->getToken(); } diff --git a/e107_handlers/vendor/phpmailer/phpmailer/src/PHPMailer.php b/e107_handlers/vendor/phpmailer/phpmailer/src/PHPMailer.php index c8fc1a824..1a65cfd8d 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -748,7 +748,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.2.0'; + const VERSION = '6.4.0'; /** * Error severity: message only, continue processing. @@ -862,18 +862,25 @@ class PHPMailer $subject = $this->encodeHeader($this->secureHeader($subject)); } //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) { $result = @mail($to, $subject, $body, $header); } else { + $this->edebug("Additional params: {$params}"); $result = @mail($to, $subject, $body, $header, $params); } - + $this->edebug('Result: ' . ($result ? 'true' : 'false')); return $result; } /** - * Output debugging info via user-defined method. - * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). + * Output debugging info via a user-defined method. + * Only generates output if debug output is enabled. * * @see PHPMailer::$Debugoutput * @see PHPMailer::$SMTPDebug @@ -1070,7 +1077,7 @@ class PHPMailer $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim $pos = strrpos($address, '@'); if (false === $pos) { - // At-sign is missing. + //At-sign is missing. $error_message = sprintf( '%s (%s): %s', $this->lang('invalid_address'), @@ -1086,7 +1093,7 @@ class PHPMailer return false; } $params = [$kind, $address, $name]; - // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { if ('Reply-To' !== $kind) { if (!array_key_exists($address, $this->RecipientsQueue)) { @@ -1103,7 +1110,7 @@ class PHPMailer return false; } - // Immediately add standard addresses without IDN. + //Immediately add standard addresses without IDN. return call_user_func_array([$this, 'addAnAddress'], $params); } @@ -1191,6 +1198,15 @@ class PHPMailer $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[] = [ 'name' => (property_exists($address, 'personal') ? $address->personal : ''), 'address' => $address->mailbox . '@' . $address->host, @@ -1214,9 +1230,15 @@ class PHPMailer } else { list($name, $email) = explode('<', $address); $email = trim(str_replace('>', '', $email)); + $name = trim($name); if (static::validateAddress($email)) { + //If this name is encoded, decode it + if (preg_match('/^=\?.*\?=$/', $name)) { + $name = mb_decode_mimeheader($name); + } $addresses[] = [ - 'name' => trim(str_replace(['"', "'"], '', $name)), + //Remove any surrounding quotes and spaces from the name + 'name' => trim($name, '\'" '), 'address' => $email, ]; } @@ -1242,7 +1264,7 @@ class PHPMailer { $address = trim($address); $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, '@'); if ( (false === $pos) @@ -1395,7 +1417,7 @@ class PHPMailer */ public function punyencodeAddress($address) { - // Verify we have required functions, CharSet, and at-sign. + //Verify we have required functions, CharSet, and at-sign. $pos = strrpos($address, '@'); if ( !empty($this->CharSet) && @@ -1403,16 +1425,20 @@ class PHPMailer static::idnSupported() ) { $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)) { - $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 $errorcode = 0; 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')) { - $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 { + //Fall back to a default we don't know about $punycode = idn_to_ascii($domain, $errorcode); } if (false !== $punycode) { @@ -1462,7 +1488,7 @@ class PHPMailer { if ( 'smtp' === $this->Mailer - || ('mail' === $this->Mailer && (PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) + || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) ) { //SMTP mandates RFC-compliant line endings //and it's also used with mail() on Windows @@ -1474,8 +1500,8 @@ class PHPMailer //Check for buggy PHP versions that add a header with an incorrect line break if ( 'mail' === $this->Mailer - && ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017) - || (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' && stripos(PHP_OS, 'WIN') === 0 ) { @@ -1488,10 +1514,10 @@ class PHPMailer } try { - $this->error_count = 0; // Reset errors + $this->error_count = 0; //Reset errors $this->mailHeader = ''; - // Dequeue recipient and Reply-To addresses with IDN + //Dequeue recipient and Reply-To addresses with IDN foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { $params[1] = $this->punyencodeAddress($params[1]); call_user_func_array([$this, 'addAnAddress'], $params); @@ -1500,7 +1526,7 @@ class PHPMailer throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); } - // Validate From, Sender, and ConfirmReadingTo addresses + //Validate From, Sender, and ConfirmReadingTo addresses foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { $this->$address_kind = trim($this->$address_kind); if (empty($this->$address_kind)) { @@ -1524,29 +1550,29 @@ class PHPMailer } } - // Set whether the message is multipart/alternative + //Set whether the message is multipart/alternative if ($this->alternativeExists()) { $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; } $this->setMessageType(); - // Refuse to send an empty message unless we are specifically allowing it + //Refuse to send an empty message unless we are specifically allowing it if (!$this->AllowEmpty && empty($this->Body)) { throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); } //Trim subject consistently $this->Subject = trim($this->Subject); - // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) $this->MIMEHeader = ''; $this->MIMEBody = $this->createBody(); - // createBody may have added some headers, so retain them + //createBody may have added some headers, so retain them $tempheaders = $this->MIMEHeader; $this->MIMEHeader = $this->createHeader(); $this->MIMEHeader .= $tempheaders; - // To capture the complete message when using mail(), create - // an extra header list which createHeader() doesn't fold in + //To capture the complete message when using mail(), create + //an extra header list which createHeader() doesn't fold in if ('mail' === $this->Mailer) { if (count($this->to) > 0) { $this->mailHeader .= $this->addrAppend('To', $this->to); @@ -1559,7 +1585,7 @@ class PHPMailer ); } - // Sign with DKIM if enabled + //Sign with DKIM if enabled if ( !empty($this->DKIM_domain) && !empty($this->DKIM_selector) @@ -1600,7 +1626,7 @@ class PHPMailer public function postSend() { try { - // Choose the mailer and send through it + //Choose the mailer and send through it switch ($this->Mailer) { case 'sendmail': case 'qmail': @@ -1645,22 +1671,44 @@ class PHPMailer */ 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; - - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { - if ('qmail' === $this->Mailer) { + //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. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + if ($this->Mailer === 'qmail') { $sendmailFmt = '%s -f%s'; } else { $sendmailFmt = '%s -oi -f%s -t'; } - } elseif ('qmail' === $this->Mailer) { - $sendmailFmt = '%s'; } 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 + //), and + //it has historically worked this way. $sendmailFmt = '%s -oi -t'; } $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) { foreach ($this->SingleToArray as $toAddr) { @@ -1668,6 +1716,7 @@ class PHPMailer if (!$mail) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } + $this->edebug("To: {$toAddr}"); fwrite($mail, 'To: ' . $toAddr . "\n"); fwrite($mail, $header); fwrite($mail, $body); @@ -1682,6 +1731,7 @@ class PHPMailer $this->From, [] ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); if (0 !== $result) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } @@ -1704,6 +1754,7 @@ class PHPMailer $this->From, [] ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); if (0 !== $result) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } @@ -1724,7 +1775,7 @@ class PHPMailer */ protected static function isShellSafe($string) { - // Future-proof + //Future-proof if ( escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) @@ -1737,9 +1788,9 @@ class PHPMailer for ($i = 0; $i < $length; ++$i) { $c = $string[$i]; - // All other characters have a special meaning in at least one common shell, including = and +. - // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. - // Note that this does permit non-Latin alphanumeric characters based on the current locale. + //All other characters have a special meaning in at least one common shell, including = and +. + //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + //Note that this does permit non-Latin alphanumeric characters based on the current locale. if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { return false; } @@ -1809,11 +1860,15 @@ class PHPMailer //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Example problem: https://www.drupal.org/node/1057954 - // 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)) { - $params = sprintf('-f%s', $this->Sender); + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); } 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'); ini_set('sendmail_from', $this->Sender); } @@ -1899,7 +1954,7 @@ class PHPMailer } $callbacks = []; - // Attempt to send to all recipients + //Attempt to send to all recipients foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { foreach ($togroup as $to) { if (!$this->smtp->recipient($to[0], $this->dsn)) { @@ -1914,7 +1969,7 @@ class PHPMailer } } - // Only send the DATA command if we have viable recipients + //Only send the DATA command if we have viable recipients if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); } @@ -1976,7 +2031,7 @@ class PHPMailer $options = $this->SMTPOptions; } - // Already connected? + //Already connected? if ($this->smtp->connected()) { return true; } @@ -1998,14 +2053,14 @@ class PHPMailer ) ) { $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); - // Not a valid host entry + //Not a valid host entry continue; } - // $hostinfo[1]: optional ssl or tls prefix - // $hostinfo[2]: the hostname - // $hostinfo[3]: optional port number - // The host string prefix can temporarily override the current setting for SMTPSecure - // If it's not specified, the default value is used + //$hostinfo[1]: optional ssl or tls prefix + //$hostinfo[2]: the hostname + //$hostinfo[3]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used //Check the host name is a valid name or IP address before trying to use it if (!static::isValidHost($hostinfo[2])) { @@ -2017,11 +2072,11 @@ class PHPMailer $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { $prefix = 'ssl://'; - $tls = false; // Can't have SSL and TLS at the same time + $tls = false; //Can't have SSL and TLS at the same time $secure = static::ENCRYPTION_SMTPS; } elseif ('tls' === $hostinfo[1]) { $tls = true; - // tls doesn't use a prefix + //TLS doesn't use a prefix $secure = static::ENCRYPTION_STARTTLS; } //Do we need the OpenSSL extension? @@ -2051,10 +2106,10 @@ class PHPMailer } $this->smtp->hello($hello); //Automatically enable TLS encryption if: - // * it's not disabled - // * we have openssl extension - // * we are not already using SSL - // * the server offers STARTTLS + //* it's not disabled + //* we have openssl extension + //* we are not already using SSL + //* the server offers STARTTLS if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { $tls = true; } @@ -2062,7 +2117,7 @@ class PHPMailer if (!$this->smtp->startTLS()) { throw new Exception($this->lang('connect_host')); } - // We must resend EHLO after TLS negotiation + //We must resend EHLO after TLS negotiation $this->smtp->hello($hello); } if ( @@ -2080,14 +2135,14 @@ class PHPMailer } catch (Exception $exc) { $lastexception = $exc; $this->edebug($exc->getMessage()); - // We must have connected, but then failed TLS or Auth, so close connection nicely + //We must have connected, but then failed TLS or Auth, so close connection nicely $this->smtp->quit(); } } } - // If we get here, all connection attempts have failed, so close connection hard + //If we get here, all connection attempts have failed, so close connection hard $this->smtp->close(); - // As we've caught all exceptions, just report whatever the last one was + //As we've caught all exceptions, just report whatever the last one was if ($this->exceptions && null !== $lastexception) { throw $lastexception; } @@ -2118,7 +2173,7 @@ class PHPMailer */ public function setLanguage($langcode = 'en', $lang_path = '') { - // Backwards compatibility for renamed language codes + //Backwards compatibility for renamed language codes $renamed_langcodes = [ 'br' => 'pt_br', 'cz' => 'cs', @@ -2134,7 +2189,7 @@ class PHPMailer $langcode = $renamed_langcodes[$langcode]; } - // Define full set of translatable strings in English + //Define full set of translatable strings in English $PHPMAILER_LANG = [ 'authenticate' => 'SMTP Error: Could not authenticate.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', @@ -2159,7 +2214,7 @@ class PHPMailer 'extension_missing' => 'Extension missing: ', ]; if (empty($lang_path)) { - // Calculate an absolute path so it can work if CWD is not here + //Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; } //Validate $langcode @@ -2168,20 +2223,20 @@ class PHPMailer } $foundlang = true; $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; - // There is no English translation file + //There is no English translation file if ('en' !== $langcode) { - // Make sure language file path is readable + //Make sure language file path is readable if (!static::fileIsAccessible($lang_file)) { $foundlang = false; } else { - // Overwrite language-specific strings. - // This way we'll never have missing translation keys. + //Overwrite language-specific strings. + //This way we'll never have missing translation keys. $foundlang = include $lang_file; } } $this->language = $PHPMAILER_LANG; - return (bool) $foundlang; // Returns false if language not found + return (bool) $foundlang; //Returns false if language not found } /** @@ -2225,7 +2280,7 @@ class PHPMailer */ public function addrFormat($addr) { - if (empty($addr[1])) { // No name provided + if (empty($addr[1])) { //No name provided return $this->secureHeader($addr[0]); } @@ -2252,8 +2307,8 @@ class PHPMailer } else { $soft_break = static::$LE; } - // If utf-8 encoding is used, we will need to make sure we don't - // split multibyte characters when we wrap + //If utf-8 encoding is used, we will need to make sure we don't + //split multibyte characters when we wrap $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet); $lelen = strlen(static::$LE); $crlflen = strlen(static::$LE); @@ -2353,29 +2408,29 @@ class PHPMailer $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); $encodedCharPos = strpos($lastChunk, '='); if (false !== $encodedCharPos) { - // Found start of encoded character byte within $lookBack block. - // Check the encoded byte value (the 2 chars after the '=') + //Found start of encoded character byte within $lookBack block. + //Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); if ($dec < 128) { - // Single byte character. - // If the encoded char was found at pos 0, it will fit - // otherwise reduce maxLength to start of the encoded char + //Single byte character. + //If the encoded char was found at pos 0, it will fit + //otherwise reduce maxLength to start of the encoded char if ($encodedCharPos > 0) { $maxLength -= $lookBack - $encodedCharPos; } $foundSplitPos = true; } elseif ($dec >= 192) { - // First byte of a multi byte character - // Reduce maxLength to split at start of character + //First byte of a multi byte character + //Reduce maxLength to split at start of character $maxLength -= $lookBack - $encodedCharPos; $foundSplitPos = true; } elseif ($dec < 192) { - // Middle byte of a multi byte character, look further back + //Middle byte of a multi byte character, look further back $lookBack += 3; } } else { - // No encoded character found + //No encoded character found $foundSplitPos = true; } } @@ -2419,7 +2474,7 @@ class PHPMailer $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); - // The To header is created automatically by mail(), so needs to be omitted here + //The To header is created automatically by mail(), so needs to be omitted here if ('mail' !== $this->Mailer) { if ($this->SingleTo) { foreach ($this->to as $toaddr) { @@ -2433,12 +2488,12 @@ class PHPMailer } $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); - // sendmail and mail() extract Cc from the header before sending + //sendmail and mail() extract Cc from the header before sending if (count($this->cc) > 0) { $result .= $this->addrAppend('Cc', $this->cc); } - // sendmail and mail() extract Bcc from the header before sending + //sendmail and mail() extract Bcc from the header before sending if ( ( 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer @@ -2452,13 +2507,13 @@ class PHPMailer $result .= $this->addrAppend('Reply-To', $this->ReplyTo); } - // mail() sets the subject itself + //mail() sets the subject itself if ('mail' !== $this->Mailer) { $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); } - // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - // https://tools.ietf.org/html/rfc5322#section-3.6.4 + //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 + //https://tools.ietf.org/html/rfc5322#section-3.6.4 if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { $this->lastMessageID = $this->MessageID; } else { @@ -2484,7 +2539,7 @@ class PHPMailer $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); } - // Add custom headers + //Add custom headers foreach ($this->CustomHeader as $header) { $result .= $this->headerLine( trim($header[0]), @@ -2526,28 +2581,24 @@ class PHPMailer $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); break; default: - // Catches case 'plain': and case '': + //Catches case 'plain': and case '': $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); $ismultipart = false; break; } - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $this->Encoding) { - // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE if ($ismultipart) { if (static::ENCODING_8BIT === $this->Encoding) { $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT); } - // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible } else { $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); } } - if ('mail' !== $this->Mailer) { -// $result .= static::$LE; - } - return $result; } @@ -2816,7 +2867,7 @@ class PHPMailer $body .= $this->attachAll('attachment', $this->boundary[1]); break; default: - // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types + //Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types //Reset the `Encoding` property in case we changed it for line length reasons $this->Encoding = $bodyEncoding; $body .= $this->encodeString($this->Body, $this->Encoding); @@ -2907,7 +2958,7 @@ class PHPMailer $result .= $this->textLine('--' . $boundary); $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); $result .= static::$LE; - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $encoding) { $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); } @@ -3005,7 +3056,7 @@ class PHPMailer throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); } - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($path); } @@ -3024,7 +3075,7 @@ class PHPMailer 2 => $name, 3 => $encoding, 4 => $type, - 5 => false, // isStringAttachment + 5 => false, //isStringAttachment 6 => $disposition, 7 => $name, ]; @@ -3064,16 +3115,16 @@ class PHPMailer */ protected function attachAll($disposition_type, $boundary) { - // Return text of body + //Return text of body $mime = []; $cidUniq = []; $incl = []; - // Add all attachments + //Add all attachments foreach ($this->attachment as $attachment) { - // Check if it is a valid disposition_filter + //Check if it is a valid disposition_filter if ($attachment[6] === $disposition_type) { - // Check for string attachment + //Check for string attachment $string = ''; $path = ''; $bString = $attachment[5]; @@ -3114,7 +3165,7 @@ class PHPMailer static::$LE ); } - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $encoding) { $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE); } @@ -3124,7 +3175,7 @@ class PHPMailer $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; } - // Allow for bypassing the Content-Disposition header + //Allow for bypassing the Content-Disposition header if (!empty($disposition)) { $encoded_name = $this->encodeHeader($this->secureHeader($name)); if (!empty($encoded_name)) { @@ -3145,7 +3196,7 @@ class PHPMailer $mime[] = static::$LE; } - // Encode as string attachment + //Encode as string attachment if ($bString) { $mime[] = $this->encodeString($string, $encoding); } else { @@ -3221,7 +3272,7 @@ class PHPMailer case static::ENCODING_7BIT: case static::ENCODING_8BIT: $encoded = static::normalizeBreaks($str); - // Make sure it ends with a line break + //Make sure it ends with a line break if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) { $encoded .= static::$LE; } @@ -3259,7 +3310,7 @@ class PHPMailer switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { - // Can't use addslashes as we don't know the value of magic_quotes_sybase + //Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return $encoded; @@ -3285,7 +3336,7 @@ class PHPMailer $charset = static::CHARSET_ASCII; } - // Q/B encoding adds 8 chars and the charset ("` =??[QB]??=`"). + //Q/B encoding adds 8 chars and the charset ("` =??[QB]??=`"). $overhead = 8 + strlen($charset); if ('mail' === $this->Mailer) { @@ -3294,26 +3345,26 @@ class PHPMailer $maxlen = static::MAX_LINE_LENGTH - $overhead; } - // Select the encoding that produces the shortest output and/or prevents corruption. + //Select the encoding that produces the shortest output and/or prevents corruption. if ($matchcount > strlen($str) / 3) { - // More than 1/3 of the content needs encoding, use B-encode. + //More than 1/3 of the content needs encoding, use B-encode. $encoding = 'B'; } elseif ($matchcount > 0) { - // Less than 1/3 of the content needs encoding, use Q-encode. + //Less than 1/3 of the content needs encoding, use Q-encode. $encoding = 'Q'; } elseif (strlen($str) > $maxlen) { - // No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. + //No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. $encoding = 'Q'; } else { - // No reformatting needed + //No reformatting needed $encoding = false; } switch ($encoding) { case 'B': if ($this->hasMultiBytes($str)) { - // Use a custom function which correctly encodes and wraps long - // multibyte strings without breaking lines within a character + //Use a custom function which correctly encodes and wraps long + //multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); @@ -3348,7 +3399,7 @@ class PHPMailer return strlen($str) > mb_strlen($str, $this->CharSet); } - // Assume no multibytes (we can't handle without mbstring functions anyway) + //Assume no multibytes (we can't handle without mbstring functions anyway) return false; } @@ -3386,11 +3437,11 @@ class PHPMailer } $mb_length = mb_strlen($str, $this->CharSet); - // Each line must have length <= 75, including $start and $end + //Each line must have length <= 75, including $start and $end $length = 75 - strlen($start) - strlen($end); - // Average multi-byte ratio + //Average multi-byte ratio $ratio = $mb_length / strlen($str); - // Base64 has a 4:3 ratio + //Base64 has a 4:3 ratio $avgLength = floor($length * $ratio * .75); $offset = 0; @@ -3405,7 +3456,7 @@ class PHPMailer $encoded .= $chunk . $linebreak; } - // Chomp the last linefeed + //Chomp the last linefeed return substr($encoded, 0, -strlen($linebreak)); } @@ -3434,12 +3485,12 @@ class PHPMailer */ public function encodeQ($str, $position = 'text') { - // There should not be any EOL in the string + //There should not be any EOL in the string $pattern = ''; $encoded = str_replace(["\r", "\n"], '', $str); switch (strtolower($position)) { case 'phrase': - // RFC 2047 section 5.3 + //RFC 2047 section 5.3 $pattern = '^A-Za-z0-9!*+\/ -'; break; /* @@ -3452,15 +3503,15 @@ class PHPMailer /* Intentional fall through */ case 'text': default: - // RFC 2047 section 5.1 - // Replace every high ascii, control, =, ? and _ characters + //RFC 2047 section 5.1 + //Replace every high ascii, control, =, ? and _ characters $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; break; } $matches = []; if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { - // If the string contains an '=', make sure it's the first thing we replace - // so as to avoid double-encoding + //If the string contains an '=', make sure it's the first thing we replace + //so as to avoid double-encoding $eqkey = array_search('=', $matches[0], true); if (false !== $eqkey) { unset($matches[0][$eqkey]); @@ -3470,8 +3521,8 @@ class PHPMailer $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); } } - // Replace spaces with _ (more readable than =20) - // RFC 2047 section 4.2(2) + //Replace spaces with _ (more readable than =20) + //RFC 2047 section 4.2(2) return str_replace(' ', '_', $encoded); } @@ -3498,7 +3549,7 @@ class PHPMailer $disposition = 'attachment' ) { try { - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($filename); } @@ -3507,14 +3558,14 @@ class PHPMailer throw new Exception($this->lang('encoding') . $encoding); } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $string, 1 => $filename, 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), 3 => $encoding, 4 => $type, - 5 => true, // isStringAttachment + 5 => true, //isStringAttachment 6 => $disposition, 7 => 0, ]; @@ -3565,7 +3616,7 @@ class PHPMailer throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); } - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($path); } @@ -3579,14 +3630,14 @@ class PHPMailer $name = $filename; } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, - 5 => false, // isStringAttachment + 5 => false, //isStringAttachment 6 => $disposition, 7 => $cid, ]; @@ -3631,7 +3682,7 @@ class PHPMailer $disposition = 'inline' ) { try { - // If a MIME type is not specified, try to work it out from the name + //If a MIME type is not specified, try to work it out from the name if ('' === $type && !empty($name)) { $type = static::filenameToType($name); } @@ -3640,14 +3691,14 @@ class PHPMailer throw new Exception($this->lang('encoding') . $encoding); } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, - 5 => true, // isStringAttachment + 5 => true, //isStringAttachment 6 => $disposition, 7 => $cid, ]; @@ -3867,8 +3918,8 @@ class PHPMailer */ public static function rfcDate() { - // Set the time zone to whatever the default is to avoid 500 errors - // Will default to UTC if it's not set properly in php.ini + //Set the time zone to whatever the default is to avoid 500 errors + //Will default to UTC if it's not set properly in php.ini date_default_timezone_set(@date_default_timezone_get()); return date('D, j M Y H:i:s O'); @@ -3946,13 +3997,13 @@ class PHPMailer protected function lang($key) { 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 ('smtp_connect_failed' === $key) { - //Include a link to troubleshooting docs on SMTP connection failure - //this is by far the biggest cause of support questions + //Include a link to troubleshooting docs on SMTP connection failure. + //This is by far the biggest cause of support questions //but it's usually not PHPMailer's fault. return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; } @@ -3987,7 +4038,7 @@ class PHPMailer public function addCustomHeader($name, $value = null) { if (null === $value && strpos($name, ':') !== false) { - // Value passed in as name:value + //Value passed in as name:value list($name, $value) = explode(':', $name, 2); } $name = trim($name); @@ -4041,11 +4092,11 @@ class PHPMailer preg_match_all('/(? 1 && '/' !== substr($basedir, -1)) { - // Ensure $basedir has a trailing / + //Ensure $basedir has a trailing / $basedir .= '/'; } foreach ($images[2] as $imgindex => $url) { - // Convert data URIs into embedded images + //Convert data URIs into embedded images //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" $match = []; if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { @@ -4059,7 +4110,7 @@ class PHPMailer } //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places //will only be embedded once, even if it used a different encoding - $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; // RFC2392 S 2 + $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2 if (!$this->cidExists($cid)) { $this->addStringEmbeddedImage( @@ -4078,13 +4129,13 @@ class PHPMailer continue; } if ( - // Only process relative URLs if a basedir is provided (i.e. no absolute local paths) + //Only process relative URLs if a basedir is provided (i.e. no absolute local paths) !empty($basedir) - // Ignore URLs containing parent dir traversal (..) + //Ignore URLs containing parent dir traversal (..) && (strpos($url, '..') === false) - // Do not change urls that are already inline images + //Do not change urls that are already inline images && 0 !== strpos($url, 'cid:') - // Do not change absolute URLs, including anonymous protocol + //Do not change absolute URLs, including anonymous protocol && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) ) { $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); @@ -4092,7 +4143,7 @@ class PHPMailer if ('.' === $directory) { $directory = ''; } - // RFC2392 S 2 + //RFC2392 S 2 $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0'; if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { $basedir .= '/'; @@ -4119,7 +4170,7 @@ class PHPMailer } } $this->isHTML(); - // Convert all message body line breaks to LE, makes quoted-printable encoding work much better + //Convert all message body line breaks to LE, makes quoted-printable encoding work much better $this->Body = static::normalizeBreaks($message); $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced)); if (!$this->alternativeExists()) { @@ -4138,9 +4189,9 @@ class PHPMailer * Example usage: * * ```php - * // Use default conversion + * //Use default conversion * $plain = $mail->html2text($html); - * // Use your own custom converter + * //Use your own custom converter * $plain = $mail->html2text($html, function($html) { * $converter = new MyHtml2text($html); * return $converter->get_text(); @@ -4307,7 +4358,7 @@ class PHPMailer */ public static function filenameToType($filename) { - // In case the path is a URL, strip any query string before getting extension + //In case the path is a URL, strip any query string before getting extension $qpos = strpos($filename, '?'); if (false !== $qpos) { $filename = substr($filename, 0, $qpos); @@ -4418,9 +4469,9 @@ class PHPMailer if (null === $breaktype) { $breaktype = static::$LE; } - // Normalise to \n + //Normalise to \n $text = str_replace([self::CRLF, "\r"], "\n", $text); - // Now convert LE as needed + //Now convert LE as needed if ("\n" !== $breaktype) { $text = str_replace("\n", $breaktype, $text); } @@ -4526,13 +4577,13 @@ class PHPMailer $privKey = openssl_pkey_get_private($privKeyStr); } if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - if (PHP_MAJOR_VERSION < 8) { + if (\PHP_MAJOR_VERSION < 8) { openssl_pkey_free($privKey); } return base64_encode($signature); } - if (PHP_MAJOR_VERSION < 8) { + if (\PHP_MAJOR_VERSION < 8) { openssl_pkey_free($privKey); } @@ -4599,7 +4650,7 @@ class PHPMailer if (empty($body)) { return self::CRLF; } - // Normalize line endings to CRLF + //Normalize line endings to CRLF $body = static::normalizeBreaks($body, self::CRLF); //Reduce multiple trailing line breaks to a single one @@ -4619,9 +4670,9 @@ class PHPMailer */ public function DKIM_Add($headers_line, $subject, $body) { - $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms - $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization methods of header & body - $DKIMquery = 'dns/txt'; // Query method + $DKIMsignatureType = 'rsa-sha256'; //Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; //Canonicalization methods of header & body + $DKIMquery = 'dns/txt'; //Query method $DKIMtime = time(); //Always sign these headers without being asked //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1 @@ -4722,7 +4773,8 @@ class PHPMailer $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; $headerValues = implode(static::$LE, $headersToSign); $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 = ''; if ('' !== $this->DKIM_identity) { $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; diff --git a/e107_handlers/vendor/phpmailer/phpmailer/src/POP3.php b/e107_handlers/vendor/phpmailer/phpmailer/src/POP3.php index 235e6372d..9bd319865 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/src/POP3.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.2.0'; + const VERSION = '6.4.0'; /** * Default POP3 port number. @@ -199,13 +199,13 @@ class POP3 public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) { $this->host = $host; - // If no port value provided, use default + //If no port value provided, use default if (false === $port) { $this->port = static::DEFAULT_PORT; } else { $this->port = (int) $port; } - // If no timeout value provided, use default + //If no timeout value provided, use default if (false === $timeout) { $this->tval = static::DEFAULT_TIMEOUT; } else { @@ -214,9 +214,9 @@ class POP3 $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; - // Reset the error log + //Reset the error log $this->errors = []; - // connect + //Connect $result = $this->connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->login($this->username, $this->password); @@ -226,7 +226,7 @@ class POP3 return true; } } - // We need to disconnect regardless of whether the login succeeded + //We need to disconnect regardless of whether the login succeeded $this->disconnect(); return false; @@ -243,7 +243,7 @@ class POP3 */ public function connect($host, $port = false, $tval = 30) { - // Are we already connected? + //Are we already connected? if ($this->connected) { return true; } @@ -256,22 +256,22 @@ class POP3 $port = static::DEFAULT_PORT; } - // connect to the POP3 server + //Connect to the POP3 server $errno = 0; $errstr = ''; $this->pop_conn = fsockopen( - $host, // POP3 Host - $port, // Port # - $errno, // Error Number - $errstr, // Error Message + $host, //POP3 Host + $port, //Port # + $errno, //Error Number + $errstr, //Error Message $tval - ); // Timeout (seconds) - // Restore the error handler + ); //Timeout (seconds) + //Restore the error handler restore_error_handler(); - // Did we connect? + //Did we connect? if (false === $this->pop_conn) { - // It would appear not... + //It would appear not... $this->setError( "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr" ); @@ -279,14 +279,14 @@ class POP3 return false; } - // Increase the stream time-out + //Increase the stream time-out stream_set_timeout($this->pop_conn, $tval, 0); - // Get the POP3 server response + //Get the POP3 server response $pop3_response = $this->getResponse(); - // Check for the +OK + //Check for the +OK if ($this->checkResponse($pop3_response)) { - // The connection is established and the POP3 server is talking + //The connection is established and the POP3 server is talking $this->connected = true; return true; @@ -316,11 +316,11 @@ class POP3 $password = $this->password; } - // Send the Username + //Send the Username $this->sendString("USER $username" . static::LE); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { - // Send the Password + //Send the Password $this->sendString("PASS $password" . static::LE); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { diff --git a/e107_handlers/vendor/phpmailer/phpmailer/src/SMTP.php b/e107_handlers/vendor/phpmailer/phpmailer/src/SMTP.php index ab7f46e4c..9d85929dd 100644 --- a/e107_handlers/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/e107_handlers/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.2.0'; + const VERSION = '6.4.0'; /** * SMTP line break constant. @@ -312,11 +312,11 @@ class SMTP */ public function connect($host, $port = null, $timeout = 30, $options = []) { - // Clear errors to avoid confusion + //Clear errors to avoid confusion $this->setError(''); - // Make sure we are __not__ connected + //Make sure we are __not__ connected if ($this->connected()) { - // Already connected, generate error + //Already connected, generate error $this->setError('Already connected to a server'); return false; @@ -324,7 +324,7 @@ class SMTP if (empty($port)) { $port = self::DEFAULT_PORT; } - // Connect to the SMTP server + //Connect to the SMTP server $this->edebug( "Connection: opening to $host:$port, timeout=$timeout, options=" . (count($options) > 0 ? var_export($options, true) : 'array()'), @@ -340,11 +340,23 @@ class SMTP $this->edebug('Connection: opened', self::DEBUG_CONNECTION); - // Get any announcement + //Get any announcement $this->last_reply = $this->get_lines(); $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); - - return true; + $responseCode = (int)substr($this->last_reply, 0, 3); + if ($responseCode === 220) { + 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; } /** @@ -397,7 +409,7 @@ class SMTP restore_error_handler(); } - // Verify we connected properly + //Verify we connected properly if (!is_resource($connection)) { $this->setError( 'Failed to connect to server', @@ -414,11 +426,11 @@ class SMTP return false; } - // SMTP server can take longer to respond, give longer timeout for first read - // Windows does not have support for this timeout function + //SMTP server can take longer to respond, give longer timeout for first read + //Windows does not have support for this timeout function if (strpos(PHP_OS, 'WIN') !== 0) { $max = (int)ini_get('max_execution_time'); - // Don't bother if unlimited, or if set_time_limit is disabled + //Don't bother if unlimited, or if set_time_limit is disabled if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { @set_time_limit($timeout); } @@ -449,7 +461,7 @@ class SMTP $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; } - // Begin encrypted connection + //Begin encrypted connection set_error_handler([$this, 'errorHandler']); $crypto_ok = stream_socket_enable_crypto( $this->smtp_conn, @@ -487,11 +499,11 @@ class SMTP } if (array_key_exists('EHLO', $this->server_caps)) { - // SMTP extensions are available; try to find a proper authentication method + //SMTP extensions are available; try to find a proper authentication method if (!array_key_exists('AUTH', $this->server_caps)) { $this->setError('Authentication is not allowed at this stage'); - // 'at this stage' means that auth may be allowed after the stage changes - // e.g. after STARTTLS + //'at this stage' means that auth may be allowed after the stage changes + //e.g. after STARTTLS return false; } @@ -535,12 +547,14 @@ class SMTP } switch ($authtype) { case 'PLAIN': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { return false; } - // Send encoded username and password + //Send encoded username and password 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', base64_encode("\0" . $username . "\0" . $password), @@ -551,7 +565,7 @@ class SMTP } break; case 'LOGIN': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { return false; } @@ -563,17 +577,17 @@ class SMTP } break; case 'CRAM-MD5': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { return false; } - // Get the challenge + //Get the challenge $challenge = base64_decode(substr($this->last_reply, 4)); - // Build the response + //Build the response $response = $username . ' ' . $this->hmac($challenge, $password); - // send encoded credentials + //send encoded credentials return $this->sendCommand('Username', base64_encode($response), 235); case 'XOAUTH2': //The OAuth instance must be set up prior to requesting auth. @@ -582,7 +596,7 @@ class SMTP } $oauth = $OAuth->getOauth64(); - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { return false; } @@ -612,15 +626,15 @@ class SMTP return hash_hmac('md5', $data, $key); } - // The following borrowed from - // http://php.net/manual/en/function.mhash.php#27225 + //The following borrowed from + //http://php.net/manual/en/function.mhash.php#27225 - // RFC 2104 HMAC implementation for php. - // Creates an md5 HMAC. - // Eliminates the need to install mhash to compute a HMAC - // by Lance Rushing + //RFC 2104 HMAC implementation for php. + //Creates an md5 HMAC. + //Eliminates the need to install mhash to compute a HMAC + //by Lance Rushing - $bytelen = 64; // byte length for md5 + $bytelen = 64; //byte length for md5 if (strlen($key) > $bytelen) { $key = pack('H*', md5($key)); } @@ -643,7 +657,7 @@ class SMTP if (is_resource($this->smtp_conn)) { $sock_status = stream_get_meta_data($this->smtp_conn); if ($sock_status['eof']) { - // The socket is valid but we are not connected + //The socket is valid but we are not connected $this->edebug( 'SMTP NOTICE: EOF caught while checking if connected', self::DEBUG_CLIENT @@ -653,7 +667,7 @@ class SMTP return false; } - return true; // everything looks good + return true; //everything looks good } return false; @@ -671,7 +685,7 @@ class SMTP $this->server_caps = null; $this->helo_rply = null; if (is_resource($this->smtp_conn)) { - // close the connection and cleanup + //Close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = null; //Makes for cleaner serialization $this->edebug('Connection: closed', self::DEBUG_CONNECTION); @@ -706,7 +720,7 @@ class SMTP * NOTE: this does not count towards line-length limit. */ - // Normalize line breaks before exploding + //Normalize line breaks before exploding $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field @@ -752,7 +766,8 @@ class SMTP //Send the lines to the server 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] === '.') { $line_out = '.' . $line_out; } @@ -786,7 +801,16 @@ class SMTP public function hello($host = '') { //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); } /** @@ -976,12 +1000,12 @@ class SMTP $this->client_send($commandstring . static::LE, $command); $this->last_reply = $this->get_lines(); - // Fetch SMTP code and possible error code explanation + //Fetch SMTP code and possible error code explanation $matches = []; if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) { $code = (int) $matches[1]; $code_ex = (count($matches) > 2 ? $matches[2] : null); - // Cut off error code from each response line + //Cut off error code from each response line $detail = preg_replace( "/{$code}[ -]" . ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', @@ -989,7 +1013,7 @@ class SMTP $this->last_reply ); } else { - // Fall back to simple parsing if regex fails + //Fall back to simple parsing if regex fails $code = (int) substr($this->last_reply, 0, 3); $code_ex = null; $detail = substr($this->last_reply, 4); @@ -1184,7 +1208,7 @@ class SMTP */ protected function get_lines() { - // If the connection is bad, give up straight away + //If the connection is bad, give up straight away if (!is_resource($this->smtp_conn)) { return ''; } @@ -1237,13 +1261,13 @@ class SMTP $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); $data .= $str; - // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), - // or 4th character is a space or a line break char, we are done reading, break the loop. - // String array access is a significant micro-optimisation over strlen + //If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), + //or 4th character is a space or a line break char, we are done reading, break the loop. + //String array access is a significant micro-optimisation over strlen if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") { break; } - // Timed-out? Log and break + //Timed-out? Log and break $info = stream_get_meta_data($this->smtp_conn); if ($info['timed_out']) { $this->edebug( @@ -1252,7 +1276,7 @@ class SMTP ); break; } - // Now check if reads took too long + //Now check if reads took too long if ($endtime && time() > $endtime) { $this->edebug( 'SMTP -> get_lines(): timelimit reached (' .