29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-24 22:39:31 +00:00

Update Composer deps

This commit is contained in:
Michael Babker 2017-11-16 08:23:18 -06:00 committed by George Wilson
parent fb257ccb4e
commit d824e5a4b2
114 changed files with 3612 additions and 4464 deletions

5
.gitignore vendored
View File

@ -157,7 +157,9 @@ Desktop.ini
/libraries/vendor/paragonie/random_compat/psalm-autoload.php
/libraries/vendor/paragonie/random_compat/psalm.xml
/libraries/vendor/paragonie/random_compat/tests
/libraries/vendor/paragonie/sodium_compat/dist
/libraries/vendor/paragonie/sodium_compat/.gitignore
/libraries/vendor/paragonie/sodium_compat/build-phar.sh
/libraries/vendor/paragonie/sodium_compat/composer.json
/libraries/vendor/paragonie/sodium_compat/composer.lock
/libraries/vendor/paragonie/sodium_compat/phpunit.xml.dist
@ -167,7 +169,10 @@ Desktop.ini
/libraries/vendor/phpmailer/phpmailer/examples
/libraries/vendor/phpmailer/phpmailer/language
/libraries/vendor/phpmailer/phpmailer/test
/libraries/vendor/phpmailer/phpmailer/.github
/libraries/vendor/phpmailer/phpmailer/.gitignore
/libraries/vendor/phpmailer/phpmailer/.phan
/libraries/vendor/phpmailer/phpmailer/.php_cs
/libraries/vendor/phpmailer/phpmailer/.scrutinizer.yml
/libraries/vendor/phpmailer/phpmailer/.travis.yml
/libraries/vendor/phpmailer/phpmailer/changelog.md

View File

@ -69,12 +69,12 @@
"joomla/string": "~2.0@dev",
"joomla/uri": "~2.0@dev",
"joomla/utilities": "~2.0@dev",
"defuse/php-encryption": "~2.1",
"fig/link-util": "~1.0",
"google/recaptcha": "~1.1",
"ircmaxell/password-compat": "1.*",
"paragonie/random_compat": "~2.0",
"paragonie/sodium_compat": "~1.2",
"phpmailer/phpmailer": "~6.0@rc",
"phpmailer/phpmailer": "~6.0",
"psr/link": "~1.0",
"symfony/polyfill-php56": "~1.0",
"symfony/console": "3.4.*@dev",

547
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,16 +12,15 @@ namespace Joomla\CMS\Service\Provider;
defined('JPATH_PLATFORM') or die;
use InvalidArgumentException;
use JFactory;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Session\Storage\JoomlaStorage;
use Joomla\Session\Storage\RuntimeStorage;
use Joomla\CMS\Session\Validator\AddressValidator;
use Joomla\CMS\Session\Validator\ForwardedValidator;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Session\Handler;
use Memcache;
use Joomla\Session\Storage\RuntimeStorage;
use Joomla\Session\Validator\AddressValidator;
use Joomla\Session\Validator\ForwardedValidator;
use Memcached;
use Redis;
use RuntimeException;
@ -51,8 +50,8 @@ class Session implements ServiceProviderInterface
'Joomla\Session\SessionInterface',
function (Container $container)
{
$config = JFactory::getConfig();
$app = JFactory::getApplication();
$config = Factory::getConfig();
$app = Factory::getApplication();
// Generate a session name.
$name = ApplicationHelper::getHash($config->get('session_name', get_class($app)));
@ -81,16 +80,6 @@ class Session implements ServiceProviderInterface
switch ($handlerType)
{
case 'apc':
if (!Handler\ApcHandler::isSupported())
{
throw new RuntimeException('APC is not supported on this system.');
}
$handler = new Handler\ApcHandler;
break;
case 'apcu':
if (!Handler\ApcuHandler::isSupported())
{
@ -102,7 +91,7 @@ class Session implements ServiceProviderInterface
break;
case 'database':
$handler = new Handler\DatabaseHandler(JFactory::getDbo());
$handler = new Handler\DatabaseHandler(Factory::getDbo());
break;
@ -139,25 +128,6 @@ class Session implements ServiceProviderInterface
break;
case 'memcache':
if (!Handler\MemcacheHandler::isSupported())
{
throw new RuntimeException('Memcache is not supported on this system.');
}
$host = $config->get('session_memcache_server_host', 'localhost');
$port = $config->get('session_memcache_server_port', 11211);
$memcache = new Memcache($config->get('session_memcache_server_id', 'joomla_cms'));
$memcache->addserver($host, $port);
$handler = new Handler\MemcacheHandler($memcache, array('ttl' => $lifetime));
ini_set('session.save_path', "$host:$port");
ini_set('session.save_handler', 'memcache');
break;
case 'redis':
if (!Handler\RedisHandler::isSupported())
{

View File

@ -1,86 +0,0 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Session\Validator;
use Joomla\Session\Exception\InvalidSessionException;
use Joomla\Session\SessionInterface;
use Joomla\Session\ValidatorInterface;
/**
* Interface for validating a part of the session
*
* @since __DEPLOY_VERSION__
*/
class AddressValidator implements ValidatorInterface
{
/**
* The input object.
*
* @var \JInput
* @since __DEPLOY_VERSION__
*/
private $input;
/**
* The session object.
*
* @var SessionInterface
* @since __DEPLOY_VERSION__
*/
private $session;
/**
* Constructor
*
* @param \JInput $input The input object
* @param SessionInterface $session The session object
*
* @since __DEPLOY_VERSION__
*/
public function __construct(\JInput $input, SessionInterface $session)
{
$this->input = $input;
$this->session = $session;
}
/**
* Validates the session throwing a SessionValidationException if there is an invalid property in the exception
*
* @param boolean $restart Reactivate session
*
* @return void
*
* @since __DEPLOY_VERSION__
* @throws InvalidSessionException
*/
public function validate($restart = false)
{
if ($restart)
{
$this->session->set('session.client.address', null);
}
$remoteAddr = $this->input->server->getString('REMOTE_ADDR', '');
// Check for client address
if (!empty($remoteAddr) && filter_var($remoteAddr, FILTER_VALIDATE_IP) !== false)
{
$ip = $this->session->get('session.client.address');
if ($ip === null)
{
$this->session->set('session.client.address', $remoteAddr);
}
elseif ($remoteAddr !== $ip)
{
throw new InvalidSessionException('Invalid client IP');
}
}
}
}

View File

@ -1,75 +0,0 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Session\Validator;
use Joomla\Session\SessionInterface;
use Joomla\Session\ValidatorInterface;
/**
* Interface for validating a part of the session
*
* @since __DEPLOY_VERSION__
*/
class ForwardedValidator implements ValidatorInterface
{
/**
* The input object.
*
* @var \JInput
* @since __DEPLOY_VERSION__
*/
private $input;
/**
* The session object.
*
* @var SessionInterface
* @since __DEPLOY_VERSION__
*/
private $session;
/**
* Constructor
*
* @param \JInput $input The input object
* @param SessionInterface $session The session object
*
* @since __DEPLOY_VERSION__
*/
public function __construct(\JInput $input, SessionInterface $session)
{
$this->input = $input;
$this->session = $session;
}
/**
* Validates the session throwing a SessionValidationException if there is an invalid property in the exception
*
* @param boolean $restart Reactivate session
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function validate($restart = false)
{
if ($restart)
{
$this->session->set('session.client.forwarded', null);
}
$xForwardedFor = $this->input->server->getString('HTTP_X_FORWARDED_FOR', '');
// Record proxy forwarded for in the session in case we need it later
if (!empty($xForwardedFor) && filter_var($xForwardedFor, FILTER_VALIDATE_IP) !== false)
{
$this->session->set('session.client.forwarded', $xForwardedFor);
}
}
}

View File

@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'CallbackFilterIterator' => $vendorDir . '/joomla/compat/src/CallbackFilterIterator.php',
'Composer\\CaBundle\\CaBundle' => $vendorDir . '/composer/ca-bundle/src/CaBundle.php',
'Defuse\\Crypto\\Core' => $vendorDir . '/defuse/php-encryption/src/Core.php',
'Defuse\\Crypto\\Crypto' => $vendorDir . '/defuse/php-encryption/src/Crypto.php',
@ -466,8 +465,6 @@ return array(
'Joomla\\CMS\\Session\\Exception\\UnsupportedStorageException' => $baseDir . '/libraries/src/Session/Exception/UnsupportedStorageException.php',
'Joomla\\CMS\\Session\\Session' => $baseDir . '/libraries/src/Session/Session.php',
'Joomla\\CMS\\Session\\Storage\\JoomlaStorage' => $baseDir . '/libraries/src/Session/Storage/JoomlaStorage.php',
'Joomla\\CMS\\Session\\Validator\\AddressValidator' => $baseDir . '/libraries/src/Session/Validator/AddressValidator.php',
'Joomla\\CMS\\Session\\Validator\\ForwardedValidator' => $baseDir . '/libraries/src/Session/Validator/ForwardedValidator.php',
'Joomla\\CMS\\String\\PunycodeHelper' => $baseDir . '/libraries/src/String/PunycodeHelper.php',
'Joomla\\CMS\\Table\\Asset' => $baseDir . '/libraries/src/Table/Asset.php',
'Joomla\\CMS\\Table\\Category' => $baseDir . '/libraries/src/Table/Category.php',
@ -539,6 +536,8 @@ return array(
'Joomla\\Controller\\ControllerInterface' => $vendorDir . '/joomla/controller/src/ControllerInterface.php',
'Joomla\\Crypt\\CipherInterface' => $vendorDir . '/joomla/crypt/src/CipherInterface.php',
'Joomla\\Crypt\\Cipher\\Crypto' => $vendorDir . '/joomla/crypt/src/Cipher/Crypto.php',
'Joomla\\Crypt\\Cipher\\OpenSSL' => $vendorDir . '/joomla/crypt/src/Cipher/OpenSSL.php',
'Joomla\\Crypt\\Cipher\\Sodium' => $vendorDir . '/joomla/crypt/src/Cipher/Sodium.php',
'Joomla\\Crypt\\Crypt' => $vendorDir . '/joomla/crypt/src/Crypt.php',
'Joomla\\Crypt\\Key' => $vendorDir . '/joomla/crypt/src/Key.php',
'Joomla\\DI\\Container' => $vendorDir . '/joomla/di/src/Container.php',
@ -674,11 +673,9 @@ return array(
'Joomla\\Registry\\Registry' => $vendorDir . '/joomla/registry/src/Registry.php',
'Joomla\\Session\\Exception\\InvalidSessionException' => $vendorDir . '/joomla/session/src/Exception/InvalidSessionException.php',
'Joomla\\Session\\HandlerInterface' => $vendorDir . '/joomla/session/src/HandlerInterface.php',
'Joomla\\Session\\Handler\\ApcHandler' => $vendorDir . '/joomla/session/src/Handler/ApcHandler.php',
'Joomla\\Session\\Handler\\ApcuHandler' => $vendorDir . '/joomla/session/src/Handler/ApcuHandler.php',
'Joomla\\Session\\Handler\\DatabaseHandler' => $vendorDir . '/joomla/session/src/Handler/DatabaseHandler.php',
'Joomla\\Session\\Handler\\FilesystemHandler' => $vendorDir . '/joomla/session/src/Handler/FilesystemHandler.php',
'Joomla\\Session\\Handler\\MemcacheHandler' => $vendorDir . '/joomla/session/src/Handler/MemcacheHandler.php',
'Joomla\\Session\\Handler\\MemcachedHandler' => $vendorDir . '/joomla/session/src/Handler/MemcachedHandler.php',
'Joomla\\Session\\Handler\\RedisHandler' => $vendorDir . '/joomla/session/src/Handler/RedisHandler.php',
'Joomla\\Session\\Handler\\WincacheHandler' => $vendorDir . '/joomla/session/src/Handler/WincacheHandler.php',
@ -701,7 +698,6 @@ return array(
'Joomla\\Uri\\UriImmutable' => $vendorDir . '/joomla/uri/src/UriImmutable.php',
'Joomla\\Uri\\UriInterface' => $vendorDir . '/joomla/uri/src/UriInterface.php',
'Joomla\\Utilities\\ArrayHelper' => $vendorDir . '/joomla/utilities/src/ArrayHelper.php',
'JsonSerializable' => $vendorDir . '/joomla/compat/src/JsonSerializable.php',
'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php',
'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php',
'PHPMailer\\PHPMailer\\PHPMailer' => $vendorDir . '/phpmailer/phpmailer/src/PHPMailer.php',

View File

@ -23,7 +23,6 @@ return array(
'87465e33b7551b401bf051928f220e9a' => $vendorDir . '/joomla/string/src/phputf8/utils/validation.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
'e40631d46120a9c38ea139981f8dab26' => $vendorDir . '/ircmaxell/password-compat/lib/password.php',
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
);

View File

@ -24,7 +24,6 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
'87465e33b7551b401bf051928f220e9a' => __DIR__ . '/..' . '/joomla/string/src/phputf8/utils/validation.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
'e40631d46120a9c38ea139981f8dab26' => __DIR__ . '/..' . '/ircmaxell/password-compat/lib/password.php',
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
);
@ -270,7 +269,6 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
);
public static $classMap = array (
'CallbackFilterIterator' => __DIR__ . '/..' . '/joomla/compat/src/CallbackFilterIterator.php',
'Composer\\CaBundle\\CaBundle' => __DIR__ . '/..' . '/composer/ca-bundle/src/CaBundle.php',
'Defuse\\Crypto\\Core' => __DIR__ . '/..' . '/defuse/php-encryption/src/Core.php',
'Defuse\\Crypto\\Crypto' => __DIR__ . '/..' . '/defuse/php-encryption/src/Crypto.php',
@ -730,8 +728,6 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
'Joomla\\CMS\\Session\\Exception\\UnsupportedStorageException' => __DIR__ . '/../../..' . '/libraries/src/Session/Exception/UnsupportedStorageException.php',
'Joomla\\CMS\\Session\\Session' => __DIR__ . '/../../..' . '/libraries/src/Session/Session.php',
'Joomla\\CMS\\Session\\Storage\\JoomlaStorage' => __DIR__ . '/../../..' . '/libraries/src/Session/Storage/JoomlaStorage.php',
'Joomla\\CMS\\Session\\Validator\\AddressValidator' => __DIR__ . '/../../..' . '/libraries/src/Session/Validator/AddressValidator.php',
'Joomla\\CMS\\Session\\Validator\\ForwardedValidator' => __DIR__ . '/../../..' . '/libraries/src/Session/Validator/ForwardedValidator.php',
'Joomla\\CMS\\String\\PunycodeHelper' => __DIR__ . '/../../..' . '/libraries/src/String/PunycodeHelper.php',
'Joomla\\CMS\\Table\\Asset' => __DIR__ . '/../../..' . '/libraries/src/Table/Asset.php',
'Joomla\\CMS\\Table\\Category' => __DIR__ . '/../../..' . '/libraries/src/Table/Category.php',
@ -803,6 +799,8 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
'Joomla\\Controller\\ControllerInterface' => __DIR__ . '/..' . '/joomla/controller/src/ControllerInterface.php',
'Joomla\\Crypt\\CipherInterface' => __DIR__ . '/..' . '/joomla/crypt/src/CipherInterface.php',
'Joomla\\Crypt\\Cipher\\Crypto' => __DIR__ . '/..' . '/joomla/crypt/src/Cipher/Crypto.php',
'Joomla\\Crypt\\Cipher\\OpenSSL' => __DIR__ . '/..' . '/joomla/crypt/src/Cipher/OpenSSL.php',
'Joomla\\Crypt\\Cipher\\Sodium' => __DIR__ . '/..' . '/joomla/crypt/src/Cipher/Sodium.php',
'Joomla\\Crypt\\Crypt' => __DIR__ . '/..' . '/joomla/crypt/src/Crypt.php',
'Joomla\\Crypt\\Key' => __DIR__ . '/..' . '/joomla/crypt/src/Key.php',
'Joomla\\DI\\Container' => __DIR__ . '/..' . '/joomla/di/src/Container.php',
@ -938,11 +936,9 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
'Joomla\\Registry\\Registry' => __DIR__ . '/..' . '/joomla/registry/src/Registry.php',
'Joomla\\Session\\Exception\\InvalidSessionException' => __DIR__ . '/..' . '/joomla/session/src/Exception/InvalidSessionException.php',
'Joomla\\Session\\HandlerInterface' => __DIR__ . '/..' . '/joomla/session/src/HandlerInterface.php',
'Joomla\\Session\\Handler\\ApcHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/ApcHandler.php',
'Joomla\\Session\\Handler\\ApcuHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/ApcuHandler.php',
'Joomla\\Session\\Handler\\DatabaseHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/DatabaseHandler.php',
'Joomla\\Session\\Handler\\FilesystemHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/FilesystemHandler.php',
'Joomla\\Session\\Handler\\MemcacheHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/MemcacheHandler.php',
'Joomla\\Session\\Handler\\MemcachedHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/MemcachedHandler.php',
'Joomla\\Session\\Handler\\RedisHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/RedisHandler.php',
'Joomla\\Session\\Handler\\WincacheHandler' => __DIR__ . '/..' . '/joomla/session/src/Handler/WincacheHandler.php',
@ -965,7 +961,6 @@ class ComposerStaticInit8462306b3e4ab2d2c9bfd5cc383e4b0c
'Joomla\\Uri\\UriImmutable' => __DIR__ . '/..' . '/joomla/uri/src/UriImmutable.php',
'Joomla\\Uri\\UriInterface' => __DIR__ . '/..' . '/joomla/uri/src/UriInterface.php',
'Joomla\\Utilities\\ArrayHelper' => __DIR__ . '/..' . '/joomla/utilities/src/ArrayHelper.php',
'JsonSerializable' => __DIR__ . '/..' . '/joomla/compat/src/JsonSerializable.php',
'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php',
'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php',
'PHPMailer\\PHPMailer\\PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/PHPMailer.php',

View File

@ -1,7 +1,7 @@
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Wed Jan 18 04:12:05 2017 GMT
## Certificate data from Mozilla as of: Wed Sep 20 03:12:05 2017 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
@ -14,7 +14,7 @@
## Just configure this file as the SSLCACertificateFile.
##
## Conversion done with mk-ca-bundle.pl version 1.27.
## SHA256: dffa79e6aa993f558e82884abf7bb54bf440ab66ee91d82a27a627f6f2a4ace4
## SHA256: 2b2dbe5244e0047e088c597998883a913f6c5fffd1cb5c0fe5a368c8466cb2ec
##
@ -130,30 +130,6 @@ Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
-----END CERTIFICATE-----
AddTrust Low-Value Services Root
================================
-----BEGIN CERTIFICATE-----
MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU
cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw
CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO
ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6
54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr
oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1
Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui
GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w
HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD
AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT
RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw
HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt
ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph
iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY
eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr
mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj
ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=
-----END CERTIFICATE-----
AddTrust External Root
======================
-----BEGIN CERTIFICATE-----
@ -178,54 +154,6 @@ e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
AddTrust Public Services Root
=============================
-----BEGIN CERTIFICATE-----
MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU
cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ
BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdC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GkwZzELMAkGA1UE
BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y
azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD
ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG
GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze
RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB
iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE=
-----END CERTIFICATE-----
Entrust Root Certification Authority
====================================
-----BEGIN CERTIFICATE-----
@ -273,27 +201,6 @@ XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm
Mw==
-----END CERTIFICATE-----
GeoTrust Global CA 2
====================
-----BEGIN CERTIFICATE-----
MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw
MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j
LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/
NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k
LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA
Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b
HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH
K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7
srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh
ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL
OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC
x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF
H4z1Ir+rzoPz4iIprn2DQKi6bA==
-----END CERTIFICATE-----
GeoTrust Universal CA
=====================
-----BEGIN CERTIFICATE-----
@ -419,56 +326,6 @@ Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z
12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
-----END CERTIFICATE-----
Com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lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF
UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF
BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW
XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2
lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn
iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67
nfhmqA==
-----END CERTIFICATE-----
Camerfirma Chambers of Commerce Root
====================================
-----BEGIN CERTIFICATE-----
@ -831,38 +662,6 @@ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy
+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS
-----END CERTIFICATE-----
Swisscom Root CA 1
==================
-----BEGIN CERTIFICATE-----
MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG
EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy
dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4
MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMC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lwzfky9NfEBWMXrrpA9gzXrzvsMn
jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ
MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H
VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl
vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl
OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3
1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq
nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy
x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW
NY6E0F/6MBr1mmz0DlP5OlvRHA==
-----END CERTIFICATE-----
DigiCert Assured ID Root CA
===========================
-----BEGIN CERTIFICATE-----
@ -1220,33 +1019,6 @@ wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
-----END CERTIFICATE-----
WellsSecure Public Root Certificate Authority
=============================================
-----BEGIN CERTIFICATE-----
MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM
F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5B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QDDC1XZWxsc1NlY3VyZSBQdWJsaWMg
Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI
K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0
bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj
qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es
E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ
tylv2G0xffX8oRAHh84vWdw+WNs=
-----END CERTIFICATE-----
COMODO ECC Certification Authority
==================================
-----BEGIN CERTIFICATE-----
@ -1308,46 +1080,6 @@ hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
-----END CERTIFICATE-----
Microsec e-Szigno Root CA
=========================
-----BEGIN CERTIFICATE-----
MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE
BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL
EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0
MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz
dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ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ElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK
yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB
S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=
-----END CERTIFICATE-----
Certigna
========
-----BEGIN CERTIFICATE-----
@ -1493,49 +1225,6 @@ vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz
TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD
-----END CERTIFICATE-----
CNNIC ROOT
==========
-----BEGIN CERTIFICATE-----
MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE
ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw
OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD
o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz
VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT
VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or
czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK
y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC
wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S
lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5
Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM
O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8
BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2
G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m
mxE=
-----END CERTIFICATE-----
ApplicationCA - Japanese Government
===================================
-----BEGIN CERTIFICATE-----
MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT
SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw
MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl
cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4
fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN
wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE
jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu
nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU
WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV
BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD
vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs
o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g
/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD
io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW
dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL
rosot4LKGAfmt1t06SAZf7IbiVQ=
-----END CERTIFICATE-----
GeoTrust Primary Certification Authority - G3
=============================================
-----BEGIN CERTIFICATE-----
@ -2630,93 +2319,6 @@ poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y
eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
-----END CERTIFICATE-----
China Internet Network Information Center EV Certificates Root
==============================================================
-----BEGIN CERTIFICATE-----
MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV
BAoMKUNoaW5hIEludGVyb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zKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC
rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX
5OfNeOI5wSsSnqaeG8XmDtkx2Q==
-----END CERTIFICATE-----
Swisscom Root EV CA 2
=====================
-----BEGIN CERTIFICATE-----
MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE
BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl
cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN
MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT
HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg
Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz
o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy
Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti
GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li
qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH
Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG
alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8q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OzyNEZiCcmmpl5fx7kLD977vHeTYuW
l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc=
-----END CERTIFICATE-----
CA Disig Root R1
================
-----BEGIN CERTIFICATE-----
@ -3538,30 +3140,6 @@ lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8
B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU=
-----END CERTIFICATE-----
TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6
====================================================
-----BEGIN CERTIFICATE-----
MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G
A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls
acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF
bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5
MDQxMFoXDTIzMTIxNjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBL
BgNVBAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSf
aSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2VydGlm
aWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQCdsGjW6L0UlqMACprx9MfMkU1xeHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a
2uqsxgbPJQ1BgfbBOCK9+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EED
wnS3/faAz1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0pu5Fb
HH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6plVxiSvgNZ1GpryHV
+DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMBAAGjQjBAMB0GA1UdDgQWBBTdVRcT
9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
9w0BAQsFAAOCAQEAb1gNl0OqFlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3R
fdCaqaXKGDsCQC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy
o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKIDgI6tflEATseW
hvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1
O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw==
-----END CERTIFICATE-----
Certinomis - Root CA
====================
-----BEGIN CERTIFICATE-----
@ -4041,3 +3619,28 @@ TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt
7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I
iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
-----END CERTIFICATE-----
TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1
=============================================
-----BEGIN CERTIFICATE-----
MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT
D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr
IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g
TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp
ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD
VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt
c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth
bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11
IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8
6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc
wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0
3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9
WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU
ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh
AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc
lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R
e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j
q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=
-----END CERTIFICATE-----

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
Copyright (c) 2012 Anthony Ferrara
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,314 +0,0 @@
<?php
/**
* A Compatibility library with PHP 5.5's simplified password hashing API.
*
* @author Anthony Ferrara <ircmaxell@php.net>
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright 2012 The Authors
*/
namespace {
if (!defined('PASSWORD_BCRYPT')) {
/**
* PHPUnit Process isolation caches constants, but not function declarations.
* So we need to check if the constants are defined separately from
* the functions to enable supporting process isolation in userland
* code.
*/
define('PASSWORD_BCRYPT', 1);
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
define('PASSWORD_BCRYPT_DEFAULT_COST', 10);
}
if (!function_exists('password_hash')) {
/**
* Hash the password using the specified algorithm
*
* @param string $password The password to hash
* @param int $algo The algorithm to use (Defined by PASSWORD_* constants)
* @param array $options The options for the algorithm to use
*
* @return string|false The hashed password, or false on error.
*/
function password_hash($password, $algo, array $options = array()) {
if (!function_exists('crypt')) {
trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING);
return null;
}
if (is_null($password) || is_int($password)) {
$password = (string) $password;
}
if (!is_string($password)) {
trigger_error("password_hash(): Password must be a string", E_USER_WARNING);
return null;
}
if (!is_int($algo)) {
trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING);
return null;
}
$resultLength = 0;
switch ($algo) {
case PASSWORD_BCRYPT:
$cost = PASSWORD_BCRYPT_DEFAULT_COST;
if (isset($options['cost'])) {
$cost = $options['cost'];
if ($cost < 4 || $cost > 31) {
trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
return null;
}
}
// The length of salt to generate
$raw_salt_len = 16;
// The length required in the final serialization
$required_salt_len = 22;
$hash_format = sprintf("$2y$%02d$", $cost);
// The expected length of the final crypt() output
$resultLength = 60;
break;
default:
trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
return null;
}
$salt_requires_encoding = false;
if (isset($options['salt'])) {
switch (gettype($options['salt'])) {
case 'NULL':
case 'boolean':
case 'integer':
case 'double':
case 'string':
$salt = (string) $options['salt'];
break;
case 'object':
if (method_exists($options['salt'], '__tostring')) {
$salt = (string) $options['salt'];
break;
}
case 'array':
case 'resource':
default:
trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
return null;
}
if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
return null;
} elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {
$salt_requires_encoding = true;
}
} else {
$buffer = '';
$buffer_valid = false;
if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {
$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);
if ($buffer) {
$buffer_valid = true;
}
}
if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {
$buffer = openssl_random_pseudo_bytes($raw_salt_len);
if ($buffer) {
$buffer_valid = true;
}
}
if (!$buffer_valid && @is_readable('/dev/urandom')) {
$f = fopen('/dev/urandom', 'r');
$read = PasswordCompat\binary\_strlen($buffer);
while ($read < $raw_salt_len) {
$buffer .= fread($f, $raw_salt_len - $read);
$read = PasswordCompat\binary\_strlen($buffer);
}
fclose($f);
if ($read >= $raw_salt_len) {
$buffer_valid = true;
}
}
if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) {
$bl = PasswordCompat\binary\_strlen($buffer);
for ($i = 0; $i < $raw_salt_len; $i++) {
if ($i < $bl) {
$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
} else {
$buffer .= chr(mt_rand(0, 255));
}
}
}
$salt = $buffer;
$salt_requires_encoding = true;
}
if ($salt_requires_encoding) {
// encode string with the Base64 variant used by crypt
$base64_digits =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
$bcrypt64_digits =
'./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$base64_string = base64_encode($salt);
$salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);
}
$salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len);
$hash = $hash_format . $salt;
$ret = crypt($password, $hash);
if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) {
return false;
}
return $ret;
}
/**
* Get information about the password hash. Returns an array of the information
* that was used to generate the password hash.
*
* array(
* 'algo' => 1,
* 'algoName' => 'bcrypt',
* 'options' => array(
* 'cost' => PASSWORD_BCRYPT_DEFAULT_COST,
* ),
* )
*
* @param string $hash The password hash to extract info from
*
* @return array The array of information about the hash.
*/
function password_get_info($hash) {
$return = array(
'algo' => 0,
'algoName' => 'unknown',
'options' => array(),
);
if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) {
$return['algo'] = PASSWORD_BCRYPT;
$return['algoName'] = 'bcrypt';
list($cost) = sscanf($hash, "$2y$%d$");
$return['options']['cost'] = $cost;
}
return $return;
}
/**
* Determine if the password hash needs to be rehashed according to the options provided
*
* If the answer is true, after validating the password using password_verify, rehash it.
*
* @param string $hash The hash to test
* @param int $algo The algorithm used for new password hashes
* @param array $options The options array passed to password_hash
*
* @return boolean True if the password needs to be rehashed.
*/
function password_needs_rehash($hash, $algo, array $options = array()) {
$info = password_get_info($hash);
if ($info['algo'] != $algo) {
return true;
}
switch ($algo) {
case PASSWORD_BCRYPT:
$cost = isset($options['cost']) ? $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
if ($cost != $info['options']['cost']) {
return true;
}
break;
}
return false;
}
/**
* Verify a password against a hash using a timing attack resistant approach
*
* @param string $password The password to verify
* @param string $hash The hash to verify against
*
* @return boolean If the password matches the hash
*/
function password_verify($password, $hash) {
if (!function_exists('crypt')) {
trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING);
return false;
}
$ret = crypt($password, $hash);
if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) {
return false;
}
$status = 0;
for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) {
$status |= (ord($ret[$i]) ^ ord($hash[$i]));
}
return $status === 0;
}
}
}
namespace PasswordCompat\binary {
if (!function_exists('PasswordCompat\\binary\\_strlen')) {
/**
* Count the number of bytes in a string
*
* We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension.
* In this case, strlen() will count the number of *characters* based on the internal encoding. A
* sequence of bytes might be regarded as a single multibyte character.
*
* @param string $binary_string The input string
*
* @internal
* @return int The number of bytes
*/
function _strlen($binary_string) {
if (function_exists('mb_strlen')) {
return mb_strlen($binary_string, '8bit');
}
return strlen($binary_string);
}
/**
* Get a substring based on byte limits
*
* @see _strlen()
*
* @param string $binary_string The input string
* @param int $start
* @param int $length
*
* @internal
* @return string The substring
*/
function _substr($binary_string, $start, $length) {
if (function_exists('mb_substr')) {
return mb_substr($binary_string, $start, $length, '8bit');
}
return substr($binary_string, $start, $length);
}
/**
* Check if current PHP version is compatible with the library
*
* @return boolean the check result
*/
function check() {
static $pass = NULL;
if (is_null($pass)) {
if (function_exists('crypt')) {
$hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';
$test = crypt("password", $hash);
$pass = $test == $hash;
} else {
$pass = false;
}
}
return $pass;
}
}
}

View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -1,78 +0,0 @@
<?php
/**
* Part of the Joomla Framework Compat Package
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
/**
* CallbackFilterIterator using the callback to determine which items are accepted or rejected.
*
* @link http://php.net/manual/en/class.callbackfilteriterator.php
* @since 1.2.0
*/
class CallbackFilterIterator extends \FilterIterator
{
/**
* The callback to check value.
*
* @var callable
*
* @since 1.2.0
*/
protected $callback = null;
/**
* Creates a filtered iterator using the callback to determine
* which items are accepted or rejected.
*
* @param \Iterator $iterator The iterator to be filtered.
* @param callable $callback The callback, which should return TRUE to accept the current item
* or FALSE otherwise. May be any valid callable value.
* The callback should accept up to three arguments: the current item,
* the current key and the iterator, respectively.
* ``` php
* function my_callback($current, $key, $iterator)
* ```
*
* @throws InvalidArgumentException
*
* @since 1.2.0
*/
public function __construct(\Iterator $iterator, $callback)
{
if (!is_callable($callback))
{
throw new \InvalidArgumentException("Argument 2 of CallbackFilterIterator should be callable.");
}
$this->callback = $callback;
parent::__construct($iterator);
}
/**
* This method calls the callback with the current value, current key and the inner iterator.
* The callback is expected to return TRUE if the current item is to be accepted, or FALSE otherwise.
*
* @link http://www.php.net/manual/en/callbackfilteriterator.accept.php
*
* @return boolean True if the current element is acceptable, otherwise false.
*
* @since 1.2.0
*/
public function accept()
{
$inner = $this->getInnerIterator();
return call_user_func_array(
$this->callback,
array(
$inner->current(),
$inner->key(),
$inner
)
);
}
}

View File

@ -1,26 +0,0 @@
<?php
/**
* Part of the Joomla Framework Compat Package
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
/**
* JsonSerializable interface. This file provides backwards compatibility to PHP 5.3 and ensures
* the interface is present in systems where JSON related code was removed.
*
* @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php
* @since 1.0
*/
interface JsonSerializable
{
/**
* Return data which should be serialized by json_encode().
*
* @return mixed
*
* @since 1.0
*/
public function jsonSerialize();
}

View File

@ -12,6 +12,7 @@ use Defuse\Crypto\Crypto as DefuseCrypto;
use Defuse\Crypto\Key as DefuseKey;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException;
use Defuse\Crypto\RuntimeTests;
use Joomla\Crypt\CipherInterface;
use Joomla\Crypt\Key;
@ -37,7 +38,7 @@ class Crypto implements CipherInterface
public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() != 'crypto')
if ($key->getType() !== 'crypto')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected crypto.');
}
@ -72,7 +73,7 @@ class Crypto implements CipherInterface
public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() != 'crypto')
if ($key->getType() !== 'crypto')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected crypto.');
}
@ -113,4 +114,25 @@ class Crypto implements CipherInterface
// Create the new encryption key object.
return new Key('crypto', $public->saveToAsciiSafeString(), $public->getRawBytes());
}
/**
* Check if the cipher is supported in this environment.
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported(): bool
{
try
{
RuntimeTests::runtimeTest();
return true;
}
catch (EnvironmentIsBrokenException $e)
{
return false;
}
}
}

View File

@ -0,0 +1,144 @@
<?php
/**
* Part of the Joomla Framework Crypt Package
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Crypt\Cipher;
use Joomla\Crypt\CipherInterface;
use Joomla\Crypt\Key;
/**
* Joomla cipher for encryption, decryption and key generation via the openssl extension.
*
* @since __DEPLOY_VERSION__
*/
class OpenSSL implements CipherInterface
{
/**
* Initialisation vector for key generator method.
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $iv;
/**
* Method to use for encryption.
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $method;
/**
* Instantiate the cipher.
*
* @param string $iv The initialisation vector to use
* @param string $method The encryption method to use
*
* @since __DEPLOY_VERSION__
*/
public function __construct(string $iv, string $method)
{
$this->iv = $iv;
$this->method = $method;
}
/**
* Method to decrypt a data string.
*
* @param string $data The encrypted string to decrypt.
* @param Key $key The key object to use for decryption.
*
* @return string The decrypted data string.
*
* @since __DEPLOY_VERSION__
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected openssl.');
}
$cleartext = openssl_decrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($cleartext === false)
{
throw new \RuntimeException('Failed to decrypt data');
}
return $cleartext;
}
/**
* Method to encrypt a data string.
*
* @param string $data The data string to encrypt.
* @param Key $key The key object to use for encryption.
*
* @return string The encrypted data string.
*
* @since __DEPLOY_VERSION__
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected openssl.');
}
$encrypted = openssl_encrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($encrypted === false)
{
throw new \RuntimeException('Unable to encrypt data');
}
return $encrypted;
}
/**
* Method to generate a new encryption key object.
*
* @param array $options Key generation options.
*
* @return Key
*
* @since __DEPLOY_VERSION__
* @throws \RuntimeException
*/
public function generateKey(array $options = [])
{
$passphrase = $options['passphrase'] ?? false;
if ($passphrase === false)
{
throw new \RuntimeException('Missing passphrase file');
}
return new Key('openssl', $passphrase, 'unused');
}
/**
* Check if the cipher is supported in this environment.
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported(): bool
{
return extension_loaded('openssl');
}
}

View File

@ -0,0 +1,142 @@
<?php
/**
* Part of the Joomla Framework Crypt Package
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Crypt\Cipher;
use Joomla\Crypt\CipherInterface;
use Joomla\Crypt\Key;
use ParagonIE\Sodium\Compat;
/**
* Cipher for sodium algorithm encryption, decryption and key generation.
*
* @since __DEPLOY_VERSION__
*/
class Sodium implements CipherInterface
{
/**
* The message nonce to be used with encryption/decryption
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $nonce;
/**
* Method to decrypt a data string.
*
* @param string $data The encrypted string to decrypt.
* @param Key $key The key object to use for decryption.
*
* @return string The decrypted data string.
*
* @since __DEPLOY_VERSION__
* @throws \RuntimeException
*/
public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected sodium.');
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
$decrypted = Compat::crypto_box_open(
$data,
$this->nonce,
Compat::crypto_box_keypair_from_secretkey_and_publickey($key->getPrivate(), $key->getPublic())
);
if ($decrypted === false)
{
throw new \RuntimeException('Malformed message or invalid MAC');
}
return $decrypted;
}
/**
* Method to encrypt a data string.
*
* @param string $data The data string to encrypt.
* @param Key $key The key object to use for encryption.
*
* @return string The encrypted data string.
*
* @since __DEPLOY_VERSION__
* @throws \RuntimeException
*/
public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new \InvalidArgumentException('Invalid key of type: ' . $key->getType() . '. Expected sodium.');
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
return Compat::crypto_box(
$data,
$this->nonce,
Compat::crypto_box_keypair_from_secretkey_and_publickey($key->getPrivate(), $key->getPublic())
);
}
/**
* Method to generate a new encryption key object.
*
* @param array $options Key generation options.
*
* @return Key
*
* @since __DEPLOY_VERSION__
* @throws RuntimeException
*/
public function generateKey(array $options = array())
{
// Generate the encryption key.
$pair = Compat::crypto_box_keypair();
return new Key('sodium', Compat::crypto_box_secretkey($pair), Compat::crypto_box_publickey($pair));
}
/**
* Check if the cipher is supported in this environment.
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported(): bool
{
return class_exists(Compat::class);
}
/**
* Set the nonce to use for encrypting/decrypting messages
*
* @param string $nonce The message nonce
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function setNonce($nonce)
{
$this->nonce = $nonce;
}
}

View File

@ -49,4 +49,13 @@ interface CipherInterface
* @since 1.0
*/
public function generateKey(array $options = array());
/**
* Check if the cipher is supported in this environment.
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported(): bool;
}

View File

@ -45,10 +45,10 @@ class Crypt
public function __construct(CipherInterface $cipher = null, Key $key = null)
{
// Set the encryption cipher.
$this->cipher = isset($cipher) ? $cipher : new Crypto;
$this->cipher = $cipher ?: new Crypto;
// Set the encryption key[/pair)].
$this->key = isset($key) ? $key : $this->generateKey();
$this->key = $key ?: $this->generateKey();
}
/**
@ -120,7 +120,6 @@ class Crypt
*/
public static function genRandomBytes($length = 16)
{
// This method is backported by the paragonie/random_compat library and native in PHP 7
return random_bytes($length);
}
}

View File

@ -48,14 +48,14 @@ class Key
*
* @since 1.0
*/
public function __construct($type, $private, $public)
public function __construct(string $type, string $private, string $public)
{
// Set the key type.
$this->type = (string) $type;
$this->type = $type;
// Set the public/private key strings.
$this->private = (string) $private;
$this->public = (string) $public;
$this->private = $private;
$this->public = $public;
}
/**
@ -65,7 +65,7 @@ class Key
*
* @since __DEPLOY_VERSION__
*/
public function getPrivate()
public function getPrivate(): string
{
return $this->private;
}
@ -77,7 +77,7 @@ class Key
*
* @since __DEPLOY_VERSION__
*/
public function getPublic()
public function getPublic(): string
{
return $this->public;
}
@ -89,7 +89,7 @@ class Key
*
* @since __DEPLOY_VERSION__
*/
public function getType()
public function getType(): string
{
return $this->type;
}

View File

@ -137,7 +137,7 @@ class DatabaseFactory
* @since __DEPLOY_VERSION__
* @throws \RuntimeException
*/
public function getIterator($name, DatabaseDriver $db, $column = null, $class = '\\stdClass')
public function getIterator(string $name, DatabaseDriver $db, $column = null, string $class = '\\stdClass'): DatabaseIterator
{
// Derive the class name from the driver.
$iteratorClass = __NAMESPACE__ . '\\' . ucfirst($name) . '\\' . ucfirst($name) . 'Iterator';

View File

@ -34,7 +34,7 @@ class ConnectionEvent extends Event
*
* @since __DEPLOY_VERSION__
*/
public function __construct($name, DatabaseInterface $driver)
public function __construct(string $name, DatabaseInterface $driver)
{
parent::__construct($name);
@ -48,7 +48,7 @@ class ConnectionEvent extends Event
*
* @since __DEPLOY_VERSION__
*/
public function getDriver()
public function getDriver(): DatabaseInterface
{
return $this->driver;
}

View File

@ -48,7 +48,7 @@ class ChainedMonitor implements QueryMonitorInterface
*
* @since __DEPLOY_VERSION__
*/
public function startQuery($sql)
public function startQuery(string $sql)
{
foreach ($this->monitors as $monitor)
{

View File

@ -30,7 +30,7 @@ class LoggingMonitor implements QueryMonitorInterface, LoggerAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public function startQuery($sql)
public function startQuery(string $sql)
{
if ($this->logger)
{

View File

@ -24,7 +24,7 @@ interface QueryMonitorInterface
*
* @since __DEPLOY_VERSION__
*/
public function startQuery($sql);
public function startQuery(string $sql);
/**
* Act on a query being stopped.

View File

@ -177,7 +177,7 @@ class Container implements ContainerInterface
*
* @since __DEPLOY_VERSION__
*/
public function isShared($resourceName)
public function isShared(string $resourceName): bool
{
return $this->hasFlag($resourceName, 'isShared', true);
}
@ -191,7 +191,7 @@ class Container implements ContainerInterface
*
* @since __DEPLOY_VERSION__
*/
public function isProtected($resourceName)
public function isProtected(string $resourceName): bool
{
return $this->hasFlag($resourceName, 'isProtected', true);
}
@ -208,7 +208,7 @@ class Container implements ContainerInterface
* @since __DEPLOY_VERSION__
* @throws KeyNotFoundException
*/
private function hasFlag($resourceName, $method, $default = true)
private function hasFlag(string $resourceName, string $method, bool $default = true): bool
{
$key = $this->resolveAlias($resourceName);
@ -507,12 +507,9 @@ class Container implements ContainerInterface
* @since __DEPLOY_VERSION__
* @throws KeyNotFoundException
*/
public function getResource($key, $bail = false)
public function getResource(string $key, bool $bail = false)
{
$key = $this->resolveAlias($key);
$raw = $this->getRaw($key);
if ($raw === null)
if (isset($this->resources[$key]))
{
return $this->resources[$key];
}

View File

@ -17,16 +17,6 @@ use Psr\Container\ContainerExceptionInterface;
*/
interface ContainerAwareInterface
{
/**
* Get the DI container.
*
* @return Container
*
* @since 1.0
* @throws ContainerExceptionInterface May be thrown if the container has not been set.
*/
public function getContainer();
/**
* Set the DI container.
*

View File

@ -33,14 +33,14 @@ trait ContainerAwareTrait
* @since 1.2
* @throws ContainerNotFoundException May be thrown if the container has not been set.
*/
public function getContainer()
protected function getContainer()
{
if ($this->container)
{
return $this->container;
}
throw new ContainerNotFoundException('Container not set in ' . __CLASS__);
throw new ContainerNotFoundException('Container not set in ' . get_class($this));
}
/**

View File

@ -96,7 +96,7 @@ class Resource
*
* @since __DEPLOY_VERSION__
*/
public function __construct(Container $container, $value, $mode = 0)
public function __construct(Container $container, $value, int $mode = 0)
{
$this->container = $container;
$this->shared = ($mode & self::SHARE) === self::SHARE;
@ -137,7 +137,7 @@ class Resource
*
* @since __DEPLOY_VERSION__
*/
public function isShared()
public function isShared(): bool
{
return $this->shared;
}
@ -149,7 +149,7 @@ class Resource
*
* @since __DEPLOY_VERSION__
*/
public function isProtected()
public function isProtected(): bool
{
return $this->protected;
}
@ -203,7 +203,7 @@ class Resource
*
* @since __DEPLOY_VERSION__
*/
public function reset()
public function reset(): bool
{
if ($this->isShared() && !$this->isProtected())
{

View File

@ -46,7 +46,7 @@ final class DelegatingDispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function addListener($eventName, callable $callback, $priority = 0)
public function addListener(string $eventName, callable $callback, int $priority = 0): bool
{
return $this->dispatcher->addListener($eventName, $callback, $priority);
}
@ -61,7 +61,7 @@ final class DelegatingDispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function dispatch($name, EventInterface $event = null)
public function dispatch(string $name, EventInterface $event = null): EventInterface
{
return $this->dispatcher->dispatch($name, $event);
}
@ -76,7 +76,7 @@ final class DelegatingDispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function removeListener($eventName, callable $listener)
public function removeListener(string $eventName, callable $listener)
{
$this->dispatcher->removeListener($eventName, $listener);
}

View File

@ -179,7 +179,7 @@ class Dispatcher implements DispatcherInterface
*
* @since 1.0
*/
public function addListener($eventName, callable $callback, $priority = 0)
public function addListener(string $eventName, callable $callback, int $priority = 0): bool
{
if (!isset($this->listeners[$eventName]))
{
@ -275,7 +275,7 @@ class Dispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function removeListener($eventName, callable $listener)
public function removeListener(string $eventName, callable $listener)
{
if (isset($this->listeners[$eventName]))
{
@ -340,7 +340,7 @@ class Dispatcher implements DispatcherInterface
{
if (is_array($params))
{
$this->addListener($eventName, [$subscriber, $params[0]], isset($params[1]) ? $params[1] : Priority::NORMAL);
$this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? Priority::NORMAL);
}
else
{
@ -383,7 +383,7 @@ class Dispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function dispatch($name, EventInterface $event = null)
public function dispatch(string $name, EventInterface $event = null): EventInterface
{
if (!($event instanceof EventInterface))
{
@ -435,7 +435,7 @@ class Dispatcher implements DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
private function getDefaultEvent($name)
private function getDefaultEvent(string $name): EventInterface
{
if (isset($this->events[$name]))
{

View File

@ -26,7 +26,7 @@ interface DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function addListener($eventName, callable $callback, $priority = 0);
public function addListener(string $eventName, callable $callback, int $priority = 0): bool;
/**
* Dispatches an event to all registered listeners.
@ -40,7 +40,7 @@ interface DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function dispatch($name, EventInterface $event = null);
public function dispatch(string $name, EventInterface $event = null): EventInterface;
/**
* Removes an event listener from the specified event.
@ -52,5 +52,5 @@ interface DispatcherInterface
*
* @since __DEPLOY_VERSION__
*/
public function removeListener($eventName, callable $listener);
public function removeListener(string $eventName, callable $listener);
}

View File

@ -32,5 +32,5 @@ interface SubscriberInterface
*
* @since __DEPLOY_VERSION__
*/
public static function getSubscribedEvents();
public static function getSubscribedEvents(): array;
}

View File

@ -58,9 +58,9 @@ abstract class AbstractTransport implements TransportInterface
*
* @since __DEPLOY_VERSION__
*/
protected function getOption($key, $default = null)
protected function getOption(string $key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
return $this->options[$key] ?? $default;
}
/**
@ -72,7 +72,7 @@ abstract class AbstractTransport implements TransportInterface
*
* @since __DEPLOY_VERSION__
*/
protected function processHeaders(array $headers)
protected function processHeaders(array $headers): array
{
$verifiedHeaders = [];

View File

@ -56,15 +56,15 @@ class Http
$this->options = $options;
if (!isset($transport))
if (!$transport)
{
$transport = (new HttpFactory)->getAvailableDriver($this->options);
}
// Ensure the transport is a TransportInterface instance or bail out
if (!($transport instanceof TransportInterface))
{
throw new \InvalidArgumentException('A valid TransportInterface object was not set.');
// Ensure the transport is a TransportInterface instance or bail out
if (!($transport instanceof TransportInterface))
{
throw new \InvalidArgumentException('A valid TransportInterface object was not set.');
}
}
$this->transport = $transport;
@ -82,7 +82,7 @@ class Http
*/
public function getOption($key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
return $this->options[$key] ?? $default;
}
/**
@ -245,10 +245,12 @@ class Http
*/
public function sendRequest(RequestInterface $request)
{
$data = $request->getBody()->getContents();
return $this->makeTransportRequest(
$request->getMethod(),
new Uri((string) $request->getUri()),
$request->getBody()->getContents(),
empty($data) ? null : $data,
$request->getHeaders()
);
}

View File

@ -83,7 +83,7 @@ class HttpFactory
foreach ($availableAdapters as $adapter)
{
/** @var $class TransportInterface */
$class = 'Joomla\\Http\\Transport\\' . ucfirst($adapter);
$class = __NAMESPACE__ . '\\Transport\\' . ucfirst($adapter);
if (class_exists($class))
{

View File

@ -281,15 +281,8 @@ class Curl extends AbstractTransport
*
* @since 1.2.1
*/
private function redirectsAllowed()
private function redirectsAllowed(): bool
{
// There are no issues on PHP 5.6 and later
if (version_compare(PHP_VERSION, '5.6', '>='))
{
return true;
}
// For PHP 5.4 and 5.5, we only need to check if open_basedir is disabled
return !ini_get('open_basedir');
return true;
}
}

View File

@ -148,9 +148,10 @@ class Stream extends AbstractTransport
$streamOptions = [
'http' => $options,
'ssl' => [
'verify_peer' => true,
'verify_depth' => 5,
]
'verify_peer' => true,
'verify_depth' => 5,
'verify_peer_name' => true,
],
];
// The cacert may be a file or path

View File

@ -36,7 +36,7 @@ class Backgroundfill extends ImageFilter
throw new \InvalidArgumentException('No color value was given. Expected string or array.');
}
$colorCode = (!empty($options['color'])) ? $options['color'] : null;
$colorCode = $options['color'] ?? null;
// Get resource dimensions
$width = imagesx($this->handle);

View File

@ -94,6 +94,12 @@ class Image implements LoggerAwareInterface
*/
protected static $formats = [];
/**
* @var boolean Flag if an image should use the best quality available. Disable for improved performance.
* @since 1.4.0
*/
protected $generateBestQuality = true;
/**
* Class constructor.
*
@ -206,8 +212,8 @@ class Image implements LoggerAwareInterface
'height' => $info[1],
'type' => $info[2],
'attributes' => $info[3],
'bits' => isset($info['bits']) ? $info['bits'] : null,
'channels' => isset($info['channels']) ? $info['channels'] : null,
'bits' => $info['bits'] ?? null,
'channels' => $info['channels'] ?? null,
'mime' => $info['mime'],
'filesize' => filesize($path),
'orientation' => self::getOrientationString((int) $info[0], (int) $info[1]),
@ -243,7 +249,7 @@ class Image implements LoggerAwareInterface
*
* @since 1.2.0
*/
private static function getOrientationString($width, $height)
private static function getOrientationString(int $width, int $height): string
{
switch (true)
{
@ -442,13 +448,16 @@ class Image implements LoggerAwareInterface
if ($this->isTransparent())
{
// Get the transparent color values for the current image.
$rgba = imagecolorsforindex($this->getHandle(), imagecolortransparent($this->getHandle()));
$rgba = imagecolorsforindex($this->getHandle(), imagecolortransparent($this->getHandle()));
$color = imagecolorallocatealpha($handle, $rgba['red'], $rgba['green'], $rgba['blue'], $rgba['alpha']);
// Set the transparent color values for the new image.
imagecolortransparent($handle, $color);
imagefill($handle, 0, 0, $color);
}
if (!$this->generateBestQuality)
{
imagecopyresized($handle, $this->getHandle(), 0, 0, $left, $top, $width, $height, $width, $height);
}
else
@ -732,11 +741,37 @@ class Image implements LoggerAwareInterface
imagefill($handle, 0, 0, $color);
}
// Use resampling for better quality
imagecopyresampled(
$handle, $this->getHandle(),
$offset->x, $offset->y, 0, 0, $dimensions->width, $dimensions->height, $this->getWidth(), $this->getHeight()
);
if (!$this->generateBestQuality)
{
imagecopyresized(
$handle,
$this->getHandle(),
$offset->x,
$offset->y,
0,
0,
$dimensions->width,
$dimensions->height,
$this->getWidth(),
$this->getHeight()
);
}
else
{
// Use resampling for better quality
imagecopyresampled(
$handle,
$this->getHandle(),
$offset->x,
$offset->y,
0,
0,
$dimensions->width,
$dimensions->height,
$this->getWidth(),
$this->getHeight()
);
}
// If we are resizing to a new image, create a new JImage object.
if ($createNew)
@ -957,7 +992,7 @@ class Image implements LoggerAwareInterface
$type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type));
// Verify that the filter type exists.
$className = 'Joomla\\Image\\Filter\\' . ucfirst($type);
$className = __NAMESPACE__ . '\\Filter\\' . ucfirst($type);
if (!class_exists($className))
{
@ -1132,4 +1167,18 @@ class Image implements LoggerAwareInterface
{
$this->destroy();
}
/**
* Method for set option of generate thumbnail method
*
* @param boolean $quality True for best quality. False for best speed.
*
* @return void
*
* @since 1.4.0
*/
public function setThumbnailGenerate($quality = true)
{
$this->generateBestQuality = (boolean) $quality;
}
}

View File

@ -88,8 +88,8 @@ abstract class Client
}
$this->application = $application;
$this->client = $client instanceof Http ? $client : HttpFactory::getHttp($options);
$this->input = $input instanceof Input ? $input : $application->input;
$this->client = $client ?: HttpFactory::getHttp($options);
$this->input = $input ?: $application->input;
$this->options = $options;
$this->version = $version;
}
@ -340,13 +340,13 @@ abstract class Client
/**
* Method used to create the header for the POST request.
*
* @param array $parameters Array containing request parameters.
* @param array $parameters Array containing request parameters.
*
* @return string The header.
*
* @since 1.0
*/
private function createHeader($parameters)
private function createHeader(array $parameters): string
{
$header = 'OAuth ';
@ -429,7 +429,7 @@ abstract class Client
*
* @since 1.0
*/
private function signRequest($url, $method, $parameters)
private function signRequest(string $url, string $method, array $parameters): array
{
// Create the signature base string.
$base = $this->baseString($url, $method, $parameters);
@ -454,7 +454,7 @@ abstract class Client
*
* @since 1.0
*/
private function baseString($url, $method, $parameters)
private function baseString(string $url, string $method, array $parameters): string
{
// Sort the parameters alphabetically
uksort($parameters, 'strcmp');
@ -542,7 +542,7 @@ abstract class Client
*
* @since 1.0
*/
private function prepareSigningKey()
private function prepareSigningKey(): string
{
return $this->safeEncode($this->getOption('consumer_secret')) . '&' . $this->safeEncode(($this->token) ? $this->token['secret'] : '');
}
@ -569,7 +569,7 @@ abstract class Client
*/
public function getOption($key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
return $this->options[$key] ?? $default;
}
/**

View File

@ -72,8 +72,8 @@ class Client
}
$this->options = $options;
$this->http = $http instanceof Http ? $http : HttpFactory::getHttp($this->options);
$this->input = $input instanceof Input ? $input : ($application instanceof AbstractWebApplication ? $application->input : new Input);
$this->http = $http ?: HttpFactory::getHttp($this->options);
$this->input = $input ?: ($application ? $application->input : new Input);
$this->application = $application;
}
@ -286,7 +286,7 @@ class Client
*/
public function getOption($key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
return $this->options[$key] ?? $default;
}
/**

View File

@ -32,7 +32,7 @@ class Factory
$type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type));
$localNamespace = __NAMESPACE__ . '\\Format';
$namespace = isset($options['format_namespace']) ? $options['format_namespace'] : $localNamespace;
$namespace = $options['format_namespace'] ?? $localNamespace;
$class = $namespace . '\\' . ucfirst($type);
if (!class_exists($class))

View File

@ -53,7 +53,8 @@ class Ini implements FormatInterface
*/
public function objectToString($object, array $options = [])
{
$options = array_merge(static::$options, $options);
$options = array_merge(static::$options, $options);
$supportArrayValues = $options['supportArrayValues'];
$local = [];
$global = [];
@ -83,14 +84,14 @@ class Ini implements FormatInterface
// Add the properties for this section.
foreach (get_object_vars($value) as $k => $v)
{
if (is_array($v) && $options['supportArrayValues'])
if (is_array($v) && $supportArrayValues)
{
$assoc = ArrayHelper::isAssociative($v);
foreach ($v as $array_key => $item)
{
$array_key = ($assoc) ? $array_key : '';
$local[] = $k . '[' . $array_key . ']=' . $this->getValueAsIni($item);
$array_key = $assoc ? $array_key : '';
$local[] = $k . '[' . $array_key . ']=' . $this->getValueAsIni($item);
}
}
else
@ -100,25 +101,25 @@ class Ini implements FormatInterface
}
// Add empty line after section if it is not the last one
if (0 != --$last)
if (0 !== --$last)
{
$local[] = '';
}
}
elseif (is_array($value) && $options['supportArrayValues'])
elseif (is_array($value) && $supportArrayValues)
{
$assoc = ArrayHelper::isAssociative($value);
foreach ($value as $array_key => $item)
{
$array_key = ($assoc) ? $array_key : '';
$global[] = $key . '[' . $array_key . ']=' . $this->getValueAsIni($item);
$array_key = $assoc ? $array_key : '';
$global[] = $key . '[' . $array_key . ']=' . $this->getValueAsIni($item);
}
}
else
{
// Not in a section so add the property to the global array.
$global[] = $key . '=' . $this->getValueAsIni($value);
$global[] = $key . '=' . $this->getValueAsIni($value);
$in_section = false;
}
}
@ -154,10 +155,10 @@ class Ini implements FormatInterface
return new \stdClass;
}
$obj = new \stdClass;
$obj = new \stdClass;
$section = false;
$array = false;
$lines = explode("\n", $data);
$array = false;
$lines = explode("\n", $data);
// Process the lines.
foreach ($lines as $line)
@ -166,7 +167,7 @@ class Ini implements FormatInterface
$line = trim($line);
// Ignore empty lines and comments.
if (empty($line) || ($line{0} == ';'))
if (empty($line) || ($line[0] === ';'))
{
continue;
}
@ -176,14 +177,14 @@ class Ini implements FormatInterface
$length = strlen($line);
// If we are processing sections and the line is a section add the object and continue.
if (($line[0] == '[') && ($line[$length - 1] == ']'))
if ($line[0] === '[' && ($line[$length - 1] === ']'))
{
$section = substr($line, 1, $length - 2);
$section = substr($line, 1, $length - 2);
$obj->$section = new \stdClass;
continue;
}
}
elseif ($line{0} == '[')
elseif ($line[0] === '[')
{
continue;
}
@ -199,11 +200,11 @@ class Ini implements FormatInterface
list ($key, $value) = explode('=', $line, 2);
// If we have an array item
if (substr($key, -1) == ']' && ($open_brace = strpos($key, '[', 1)) !== false)
if (substr($key, -1) === ']' && ($open_brace = strpos($key, '[', 1)) !== false)
{
if ($options['supportArrayValues'])
{
$array = true;
$array = true;
$array_key = substr($key, $open_brace + 1, -1);
// If we have a multi-dimensional array or malformed key
@ -231,10 +232,10 @@ class Ini implements FormatInterface
// If the value is quoted then we assume it is a string.
$length = strlen($value);
if ($length && ($value[0] == '"') && ($value[$length - 1] == '"'))
if ($length && ($value[0] === '"') && ($value[$length - 1] === '"'))
{
// Strip the quotes and Convert the new line characters.
$value = stripcslashes(substr($value, 1, ($length - 2)));
$value = stripcslashes(substr($value, 1, $length - 2));
$value = str_replace('\n', "\n", $value);
}
else
@ -242,19 +243,19 @@ class Ini implements FormatInterface
// If the value is not quoted, we assume it is not a string.
// If the value is 'false' assume boolean false.
if ($value == 'false')
if ($value === 'false')
{
$value = false;
}
elseif ($value == 'true')
elseif ($value === 'true')
// If the value is 'true' assume boolean true.
{
$value = true;
}
elseif ($options['parseBooleanWords'] && in_array(strtolower($value), ['yes', 'no']))
elseif ($options['parseBooleanWords'] && in_array(strtolower($value), ['yes', 'no'], true))
// If the value is 'yes' or 'no' and option is enabled assume appropriate boolean
{
$value = (strtolower($value) == 'yes');
$value = (strtolower($value) === 'yes');
}
elseif (is_numeric($value))
// If the value is numeric than it is either a float or int.
@ -354,7 +355,7 @@ class Ini implements FormatInterface
case 'string':
// Sanitize any CRLF characters..
$string = '"' . str_replace(array("\r\n", "\n"), '\\n', $value) . '"';
$string = '"' . str_replace(["\r\n", "\n"], '\\n', $value) . '"';
break;
}

View File

@ -30,10 +30,10 @@ class Json implements FormatInterface
*/
public function objectToString($object, array $options = [])
{
$bitmask = isset($options['bitmask']) ? $options['bitmask'] : 0;
$depth = isset($options['depth']) ? $options['depth'] : 512;
$bitMask = $options['bitmask'] ?? 0;
$depth = $options['depth'] ?? 512;
return json_encode($object, $bitmask, $depth);
return json_encode($object, $bitMask, $depth);
}
/**
@ -51,18 +51,19 @@ class Json implements FormatInterface
*/
public function stringToObject($data, array $options = ['processSections' => false])
{
$data = trim($data);
if ((substr($data, 0, 1) != '{') && (substr($data, -1, 1) != '}'))
{
return Factory::getFormat('Ini')->stringToObject($data, $options);
}
$decoded = json_decode($data);
// Check for an error decoding the data
if ($decoded === null)
{
$data = trim($data);
// If it's an ini file, parse as ini.
if ($data !== '' && $data[0] !== '{')
{
return Factory::getFormat('Ini')->stringToObject($data, $options);
}
throw new \RuntimeException(sprintf('Error decoding JSON data: %s', json_last_error_msg()));
}

View File

@ -31,7 +31,7 @@ class Php implements FormatInterface
public function objectToString($object, array $params = [])
{
// A class must be provided
$class = !empty($params['class']) ? $params['class'] : 'Registry';
$class = $params['class'] ?? 'Registry';
// Build the object variables string
$vars = '';
@ -44,14 +44,14 @@ class Php implements FormatInterface
$str = "<?php\n";
// If supplied, add a namespace to the class object
if (isset($params['namespace']) && $params['namespace'] != '')
if (isset($params['namespace']) && $params['namespace'] !== '')
{
$str .= "namespace " . $params['namespace'] . ";\n\n";
$str .= 'namespace ' . $params['namespace'] . ";\n\n";
}
$str .= "class $class {\n";
$str .= $vars;
$str .= "}";
$str .= '}';
// Use the closing tag if it not set to false in parameters.
if (!isset($params['closingtag']) || $params['closingtag'] !== false)
@ -111,7 +111,7 @@ class Php implements FormatInterface
*
* @param array $a The array to get as a string.
*
* @return array
* @return string
*
* @since 1.0
*/
@ -122,7 +122,7 @@ class Php implements FormatInterface
foreach ($a as $k => $v)
{
$s .= ($i) ? ', ' : '';
$s .= $i ? ', ' : '';
$s .= "'" . addcslashes($k, '\\\'') . "' => ";
$s .= $this->formatValue($v);

View File

@ -33,8 +33,8 @@ class Xml implements FormatInterface
*/
public function objectToString($object, array $options = [])
{
$rootName = (isset($options['name'])) ? $options['name'] : 'registry';
$nodeName = (isset($options['nodeName'])) ? $options['nodeName'] : 'node';
$rootName = $options['name'] ?? 'registry';
$nodeName = $options['nodeName'] ?? 'node';
// Create the root node.
$root = simplexml_load_string('<' . $rootName . ' />');

View File

@ -71,7 +71,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
/**
* Magic function to clone the registry object.
*
* @return Registry
* @return void
*
* @since 1.0
*/
@ -158,7 +158,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
$nodes = explode($this->separator, $path);
// Initialize the current node to be the registry root.
$node = $this->data;
$node = $this->data;
$found = false;
// Traverse the registry to find the correct node for the result.
@ -166,7 +166,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
{
if (is_array($node) && isset($node[$n]))
{
$node = $node[$n];
$node = $node[$n];
$found = true;
continue;
}
@ -176,7 +176,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
return false;
}
$node = $node->$n;
$node = $node->$n;
$found = true;
}
@ -210,7 +210,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
$nodes = explode($this->separator, trim($path));
// Initialize the current node to be the registry root.
$node = $this->data;
$node = $this->data;
$found = false;
// Traverse the registry to find the correct node for the result.
@ -218,7 +218,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
{
if (is_array($node) && isset($node[$n]))
{
$node = $node[$n];
$node = $node[$n];
$found = true;
continue;
@ -229,7 +229,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
return $default;
}
$node = $node->$n;
$node = $node->$n;
$found = true;
}
@ -378,7 +378,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
{
$data = $this->get($path);
if (is_null($data))
if (null === $data)
{
return null;
}
@ -481,7 +481,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
{
if (is_object($node))
{
if (!isset($node->{$nodes[$i]}) && ($i != $n))
if (!isset($node->{$nodes[$i]}) && ($i !== $n))
{
$node->{$nodes[$i]} = new \stdClass;
}
@ -494,7 +494,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
if (is_array($node))
{
if (!isset($node[$nodes[$i]]) && ($i != $n))
if (($i !== $n) && !isset($node[$nodes[$i]]))
{
$node[$nodes[$i]] = new \stdClass;
}
@ -555,7 +555,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
{
if (is_object($node))
{
if (!isset($node->{$nodes[$i]}) && ($i != $n))
if (!isset($node->{$nodes[$i]}) && ($i !== $n))
{
$node->{$nodes[$i]} = new \stdClass;
}
@ -565,7 +565,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
}
elseif (is_array($node))
{
if (!isset($node[$nodes[$i]]) && ($i != $n))
if (($i !== $n) && !isset($node[$nodes[$i]]))
{
$node[$nodes[$i]] = new \stdClass;
}
@ -576,12 +576,12 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
}
if (!is_array($node))
// Convert the node to array to make append possible
// Convert the node to array to make append possible
{
$node = get_object_vars($node);
}
array_push($node, $value);
$node[] = $value;
$result = $value;
}
@ -645,9 +645,7 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \
$this->initialized = true;
// Ensure the input data is an array.
$data = is_object($data)
? get_object_vars($data)
: (array) $data;
$data = is_object($data) ? get_object_vars($data) : (array) $data;
foreach ($data as $k => $v)
{

View File

@ -1,144 +0,0 @@
<?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Handler;
use Joomla\Session\HandlerInterface;
/**
* APC session storage handler
*
* @since __DEPLOY_VERSION__
*/
class ApcHandler implements HandlerInterface
{
/**
* Session ID prefix to avoid naming conflicts
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $prefix;
/**
* Constructor
*
* @param array $options Associative array of options to configure the handler
*
* @since __DEPLOY_VERSION__
*/
public function __construct(array $options = [])
{
// Namespace our session IDs to avoid potential conflicts
$this->prefix = isset($options['prefix']) ? $options['prefix'] : 'jfw';
}
/**
* Close the session
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function close()
{
return true;
}
/**
* Destroy a session
*
* @param integer $session_id The session ID being destroyed
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function destroy($session_id)
{
return apc_delete($this->prefix . $session_id);
}
/**
* Cleanup old sessions
*
* @param integer $maxlifetime Sessions that have not updated for the last maxlifetime seconds will be removed
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function gc($maxlifetime)
{
return true;
}
/**
* Test to see if the HandlerInterface is available
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
{
$supported = extension_loaded('apc') && ini_get('apc.enabled');
// If on the CLI interface, the `apc.enable_cli` option must also be enabled
if ($supported && php_sapi_name() === 'cli')
{
$supported = ini_get('apc.enable_cli');
}
return (bool) $supported;
}
/**
* Initialize session
*
* @param string $save_path The path where to store/retrieve the session
* @param string $session_id The session id
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function open($save_path, $session_id)
{
return true;
}
/**
* Read session data
*
* @param string $session_id The session id to read data for
*
* @return string The session data
*
* @since __DEPLOY_VERSION__
*/
public function read($session_id)
{
return (string) apc_fetch($this->prefix . $session_id);
}
/**
* Write session data
*
* @param string $session_id The session id
* @param string $session_data The encoded session data
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function write($session_id, $session_data)
{
return apc_store($this->prefix . $session_id, $session_data, ini_get('session.gc_maxlifetime'));
}
}

View File

@ -86,7 +86,7 @@ class ApcuHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
$supported = extension_loaded('apcu') && ini_get('apc.enabled');

View File

@ -202,7 +202,7 @@ class DatabaseHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
return interface_exists(DatabaseInterface::class);
}

View File

@ -26,12 +26,9 @@ class FilesystemHandler extends \SessionHandler implements HandlerInterface
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function __construct($path = null)
public function __construct(string $path = '')
{
if (null === $path)
{
$path = ini_get('session.save_path');
}
$path = $path ?: ini_get('session.save_path');
// If the path is still empty, then we can't use this handler
if (empty($path))
@ -61,8 +58,11 @@ class FilesystemHandler extends \SessionHandler implements HandlerInterface
}
}
ini_set('session.save_path', $path);
ini_set('session.save_handler', 'files');
if (!headers_sent())
{
ini_set('session.save_path', $path);
ini_set('session.save_handler', 'files');
}
}
/**
@ -72,7 +72,7 @@ class FilesystemHandler extends \SessionHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
return true;
}

View File

@ -1,159 +0,0 @@
<?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Handler;
use Joomla\Session\HandlerInterface;
/**
* Memcache session storage handler
*
* @since __DEPLOY_VERSION__
*/
class MemcacheHandler implements HandlerInterface
{
/**
* Memcache driver
*
* @var \Memcache
* @since __DEPLOY_VERSION__
*/
private $memcache;
/**
* Session ID prefix to avoid naming conflicts
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $prefix;
/**
* Time to live in seconds
*
* @var integer
* @since __DEPLOY_VERSION__
*/
private $ttl;
/**
* Constructor
*
* @param \Memcache $memcache A Memcache instance
* @param array $options Associative array of options to configure the handler
*
* @since __DEPLOY_VERSION__
*/
public function __construct(\Memcache $memcache, array $options = [])
{
$this->memcache = $memcache;
// Set the default time-to-live based on the Session object's default configuration
$this->ttl = isset($options['ttl']) ? (int) $options['ttl'] : 900;
// Namespace our session IDs to avoid potential conflicts
$this->prefix = isset($options['prefix']) ? $options['prefix'] : 'jfw';
}
/**
* Close the session
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function close()
{
return $this->memcache->close();
}
/**
* Destroy a session
*
* @param integer $session_id The session ID being destroyed
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function destroy($session_id)
{
return $this->memcache->delete($this->prefix . $session_id);
}
/**
* Cleanup old sessions
*
* @param integer $maxlifetime Sessions that have not updated for the last maxlifetime seconds will be removed
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function gc($maxlifetime)
{
// Memcache manages garbage collection on its own
return true;
}
/**
* Test to see if the HandlerInterface is available
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
{
return extension_loaded('memcache') && class_exists('Memcache');
}
/**
* Initialize session
*
* @param string $save_path The path where to store/retrieve the session
* @param string $session_id The session id
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function open($save_path, $session_id)
{
return true;
}
/**
* Read session data
*
* @param string $session_id The session id to read data for
*
* @return string The session data
*
* @since __DEPLOY_VERSION__
*/
public function read($session_id)
{
return $this->memcache->get($this->prefix . $session_id) ?: '';
}
/**
* Write session data
*
* @param string $session_id The session id
* @param string $session_data The encoded session data
*
* @return boolean True on success, false otherwise
*
* @since __DEPLOY_VERSION__
*/
public function write($session_id, $session_data)
{
return $this->memcache->set($this->prefix . $session_id, $session_data, 0, time() + $this->ttl);
}
}

View File

@ -108,7 +108,7 @@ class MemcachedHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
/*
* GAE and HHVM have both had instances where Memcached the class was defined but no extension was loaded.

View File

@ -111,7 +111,7 @@ class RedisHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
return extension_loaded('redis') && class_exists('Redis');
}

View File

@ -24,7 +24,10 @@ class WincacheHandler extends \SessionHandler implements HandlerInterface
*/
public function __construct()
{
ini_set('session.save_handler', 'wincache');
if (!headers_sent())
{
ini_set('session.save_handler', 'wincache');
}
}
/**
@ -34,7 +37,7 @@ class WincacheHandler extends \SessionHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
return extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), "1");
}

View File

@ -90,7 +90,7 @@ class XCacheHandler implements HandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported()
public static function isSupported(): bool
{
// XCache is not supported on CLI
return extension_loaded('xcache') && php_sapi_name() != 'cli';

View File

@ -22,5 +22,5 @@ interface HandlerInterface extends \SessionHandlerInterface
*
* @since __DEPLOY_VERSION__
*/
public static function isSupported();
public static function isSupported(): bool;
}

View File

@ -207,7 +207,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public function setName($name)
public function setName(string $name)
{
$this->store->setName($name);
@ -235,7 +235,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public function setId($id)
public function setId(string $id)
{
$this->store->setId($id);
@ -249,7 +249,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public static function getHandlers()
public static function getHandlers(): array
{
$connectors = [];
@ -324,7 +324,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public function isStarted()
public function isStarted(): bool
{
return $this->store->isStarted();
}
@ -397,7 +397,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
public function remove($name)
public function remove(string $name)
{
if (!$this->isActive())
{
@ -603,7 +603,7 @@ class Session implements SessionInterface, DispatcherAwareInterface
*
* @since __DEPLOY_VERSION__
*/
protected function createToken($length = 32)
protected function createToken(int $length = 32): string
{
return bin2hex(random_bytes($length));
}
@ -711,7 +711,10 @@ class Session implements SessionInterface, DispatcherAwareInterface
}
// Sync the session maxlifetime
ini_set('session.gc_maxlifetime', $this->getExpire());
if (!headers_sent())
{
ini_set('session.gc_maxlifetime', $this->getExpire());
}
return true;
}

View File

@ -33,7 +33,7 @@ class SessionEvent extends Event
*
* @since __DEPLOY_VERSION__
*/
public function __construct($name, SessionInterface $session)
public function __construct(string $name, SessionInterface $session)
{
parent::__construct($name);
@ -47,7 +47,7 @@ class SessionEvent extends Event
*
* @since __DEPLOY_VERSION__
*/
public function getSession()
public function getSession(): SessionInterface
{
return $this->session;
}

View File

@ -42,7 +42,7 @@ interface SessionInterface extends \IteratorAggregate
*
* @since __DEPLOY_VERSION__
*/
public function setName($name);
public function setName(string $name);
/**
* Get the session ID
@ -62,7 +62,7 @@ interface SessionInterface extends \IteratorAggregate
*
* @since __DEPLOY_VERSION__
*/
public function setId($id);
public function setId(string $id);
/**
* Check if the session is active
@ -135,7 +135,7 @@ interface SessionInterface extends \IteratorAggregate
*
* @since __DEPLOY_VERSION__
*/
public function remove($name);
public function remove(string $name);
/**
* Clears all variables from the session store

View File

@ -61,9 +61,13 @@ class NativeStorage implements StorageInterface
public function __construct(\SessionHandlerInterface $handler = null, array $options = [])
{
// Disable transparent sid support
ini_set('session.use_trans_sid', '0');
$options['use_transport_sid'] = '0';
if (!headers_sent() && (int) ini_get('session.use_cookies') !== 1)
{
ini_set('session.use_cookies', 1);
}
ini_set('session.use_cookies', 1);
session_cache_limiter('none');
session_register_shutdown();
@ -78,7 +82,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function all()
public function all(): array
{
return $_SESSION;
}
@ -121,7 +125,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function get($name, $default)
public function get(string $name, $default)
{
if (!$this->isStarted())
{
@ -143,7 +147,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function getHandler()
public function getHandler(): \SessionHandlerInterface
{
return $this->handler;
}
@ -155,7 +159,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function getId()
public function getId(): string
{
return session_id();
}
@ -167,7 +171,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function getName()
public function getName(): string
{
return session_name();
}
@ -181,7 +185,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function has($name)
public function has(string $name): bool
{
if (!$this->isStarted())
{
@ -198,7 +202,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function isActive()
public function isActive(): bool
{
return $this->active = session_status() === \PHP_SESSION_ACTIVE;
}
@ -210,7 +214,7 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function isStarted()
public function isStarted(): bool
{
return $this->started;
}
@ -224,14 +228,14 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function remove($name)
public function remove(string $name)
{
if (!$this->isStarted())
{
$this->start();
}
$old = isset($_SESSION[$name]) ? $_SESSION[$name] : null;
$old = $_SESSION[$name] ?? null;
unset($_SESSION[$name]);
@ -251,7 +255,7 @@ class NativeStorage implements StorageInterface
* @see session_regenerate_id()
* @since __DEPLOY_VERSION__
*/
public function regenerate($destroy = false)
public function regenerate(bool $destroy = false): bool
{
return session_regenerate_id($destroy);
}
@ -266,14 +270,14 @@ class NativeStorage implements StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function set($name, $value = null)
public function set(string $name, $value = null)
{
if (!$this->isStarted())
{
$this->start();
}
$old = isset($_SESSION[$name]) ? $_SESSION[$name] : null;
$old = $_SESSION[$name] ?? null;
$_SESSION[$name] = $value;
@ -322,7 +326,7 @@ class NativeStorage implements StorageInterface
* @since __DEPLOY_VERSION__
* @throws \LogicException
*/
public function setId($id)
public function setId(string $id)
{
if ($this->isActive())
{
@ -344,7 +348,7 @@ class NativeStorage implements StorageInterface
* @since __DEPLOY_VERSION__
* @throws \LogicException
*/
public function setName($name)
public function setName(string $name)
{
if ($this->isActive())
{
@ -372,13 +376,18 @@ class NativeStorage implements StorageInterface
*/
public function setOptions(array $options)
{
if (headers_sent())
{
return $this;
}
$validOptions = array_flip(
[
'cache_limiter', 'cookie_domain', 'cookie_httponly', 'cookie_lifetime', 'cookie_path', 'cookie_secure', 'entropy_file',
'entropy_length', 'gc_divisor', 'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character', 'hash_function', 'name',
'referer_check', 'serialize_handler', 'use_cookies', 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled',
'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', 'upload_progress.freq', 'upload_progress.min-freq',
'url_rewriter.tags',
'referer_check', 'serialize_handler', 'use_strict_mode', 'use_cookies', 'use_only_cookies', 'use_trans_sid',
'upload_progress.enabled', 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', 'upload_progress.freq',
'upload_progress.min-freq', 'url_rewriter.tags', 'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags',
]
);

View File

@ -63,7 +63,7 @@ class RuntimeStorage implements StorageInterface
*
* @return array
*/
public function all()
public function all(): array
{
return $this->data;
}
@ -96,7 +96,7 @@ class RuntimeStorage implements StorageInterface
*
* @return string
*/
private function generateId()
private function generateId(): string
{
return hash('sha256', uniqid(mt_rand()));
}
@ -109,7 +109,7 @@ class RuntimeStorage implements StorageInterface
*
* @return mixed Value of a variable
*/
public function get($name, $default)
public function get(string $name, $default)
{
if (!$this->isStarted())
{
@ -129,7 +129,7 @@ class RuntimeStorage implements StorageInterface
*
* @return string The session ID
*/
public function getId()
public function getId(): string
{
return $this->id;
}
@ -139,7 +139,7 @@ class RuntimeStorage implements StorageInterface
*
* @return string The session name
*/
public function getName()
public function getName(): string
{
return $this->name;
}
@ -151,7 +151,7 @@ class RuntimeStorage implements StorageInterface
*
* @return boolean True if the variable exists
*/
public function has($name)
public function has(string $name): bool
{
if (!$this->isStarted())
{
@ -166,7 +166,7 @@ class RuntimeStorage implements StorageInterface
*
* @return boolean
*/
public function isActive()
public function isActive(): bool
{
return $this->active = $this->started;
}
@ -176,7 +176,7 @@ class RuntimeStorage implements StorageInterface
*
* @return boolean
*/
public function isStarted()
public function isStarted(): bool
{
return $this->started;
}
@ -188,14 +188,14 @@ class RuntimeStorage implements StorageInterface
*
* @return mixed The value from session or NULL if not set
*/
public function remove($name)
public function remove(string $name)
{
if (!$this->isStarted())
{
$this->start();
}
$old = isset($this->data[$name]) ? $this->data[$name] : null;
$old = $this->data[$name] ?? null;
unset($this->data[$name]);
@ -214,7 +214,7 @@ class RuntimeStorage implements StorageInterface
*
* @see session_regenerate_id()
*/
public function regenerate($destroy = false)
public function regenerate(bool $destroy = false): bool
{
if ($destroy)
{
@ -232,14 +232,14 @@ class RuntimeStorage implements StorageInterface
*
* @return mixed Old value of a variable.
*/
public function set($name, $value = null)
public function set(string $name, $value = null)
{
if (!$this->isStarted())
{
$this->start();
}
$old = isset($this->data[$name]) ? $this->data[$name] : null;
$old = $this->data[$name] ?? null;
$this->data[$name] = $value;
@ -255,7 +255,7 @@ class RuntimeStorage implements StorageInterface
*
* @throws \LogicException
*/
public function setId($id)
public function setId(string $id)
{
if ($this->isActive())
{
@ -276,7 +276,7 @@ class RuntimeStorage implements StorageInterface
*
* @throws \LogicException
*/
public function setName($name)
public function setName(string $name)
{
if ($this->isActive())
{

View File

@ -22,7 +22,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function getName();
public function getName(): string;
/**
* Set the session name
@ -33,7 +33,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function setName($name);
public function setName(string $name);
/**
* Get the session ID
@ -42,7 +42,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function getId();
public function getId(): string;
/**
* Set the session ID
@ -53,7 +53,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function setId($id);
public function setId(string $id);
/**
* Check if the session is active
@ -62,7 +62,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function isActive();
public function isActive(): bool;
/**
* Check if the session is started
@ -71,7 +71,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function isStarted();
public function isStarted(): bool;
/**
* Get data from the session store
@ -83,7 +83,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function get($name, $default);
public function get(string $name, $default);
/**
* Set data into the session store
@ -95,7 +95,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function set($name, $value);
public function set(string $name, $value);
/**
* Check whether data exists in the session store
@ -106,7 +106,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function has($name);
public function has(string $name): bool;
/**
* Unset a variable from the session store
@ -117,7 +117,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function remove($name);
public function remove(string $name);
/**
* Clears all variables from the session store
@ -135,7 +135,7 @@ interface StorageInterface
*
* @since __DEPLOY_VERSION__
*/
public function all();
public function all(): array;
/**
* Start a session
@ -159,7 +159,7 @@ interface StorageInterface
* @see session_regenerate_id()
* @since __DEPLOY_VERSION__
*/
public function regenerate($destroy = false);
public function regenerate(bool $destroy = false): bool;
/**
* Writes session data and ends session

View File

@ -60,7 +60,7 @@ class AddressValidator implements ValidatorInterface
* @since __DEPLOY_VERSION__
* @throws InvalidSessionException
*/
public function validate($restart = false)
public function validate(bool $restart = false)
{
if ($restart)
{

View File

@ -58,7 +58,7 @@ class ForwardedValidator implements ValidatorInterface
*
* @since __DEPLOY_VERSION__
*/
public function validate($restart = false)
public function validate(bool $restart = false)
{
if ($restart)
{

View File

@ -25,5 +25,5 @@ interface ValidatorInterface
* @since __DEPLOY_VERSION__
* @throws Exception\InvalidSessionException
*/
public function validate($restart = false);
public function validate(bool $restart = false);
}

View File

@ -127,7 +127,7 @@ class Inflector
* @since 1.0
* @throws InvalidArgumentException
*/
private function addRule($data, $ruleType)
private function addRule($data, string $ruleType)
{
if (is_string($data))
{
@ -155,7 +155,7 @@ class Inflector
*
* @since 1.0
*/
private function getCachedPlural($singular)
private function getCachedPlural(string $singular)
{
$singular = StringHelper::strtolower($singular);
@ -177,7 +177,7 @@ class Inflector
*
* @since 1.0
*/
private function getCachedSingular($plural)
private function getCachedSingular(string $plural)
{
return array_search(StringHelper::strtolower($plural), $this->cache);
}
@ -195,7 +195,7 @@ class Inflector
*
* @since 1.0
*/
private function matchRegexRule($word, $ruleType)
private function matchRegexRule(string $word, string $ruleType)
{
// Cycle through the regex rules.
foreach ($this->rules[$ruleType] as $regex => $replacement)
@ -222,11 +222,11 @@ class Inflector
*
* @since 1.0
*/
private function setCache($singular, $plural = null)
private function setCache(string $singular, string $plural = '')
{
$singular = StringHelper::strtolower($singular);
if ($plural === null)
if ($plural === '')
{
$plural = $singular;
}
@ -243,7 +243,7 @@ class Inflector
*
* @param mixed $data A string or an array of strings to add.
*
* @return Inflector Returns this object to support chaining.
* @return $this
*
* @since 1.0
*/
@ -260,11 +260,11 @@ class Inflector
* @param string $singular The singular form of the word.
* @param string $plural The plural form of the word. If omitted, it is assumed the singular and plural are identical.
*
* @return Inflector Returns this object to support chaining.
* @return $this
*
* @since 1.0
*/
public function addWord($singular, $plural = null)
public function addWord($singular, $plural = '')
{
$this->setCache($singular, $plural);
@ -276,7 +276,7 @@ class Inflector
*
* @param mixed $data A string or an array of regex rules to add.
*
* @return Inflector Returns this object to support chaining.
* @return $this
*
* @since 1.0
*/
@ -292,7 +292,7 @@ class Inflector
*
* @param mixed $data A string or an array of regex rules to add.
*
* @return Inflector Returns this object to support chaining.
* @return $this
*
* @since 1.0
*/
@ -308,7 +308,7 @@ class Inflector
*
* @param boolean $new If true (default is false), returns a new instance regardless if one exists. This argument is mainly used for testing.
*
* @return Inflector
* @return static
*
* @since 1.0
*/
@ -338,7 +338,7 @@ class Inflector
*/
public function isCountable($word)
{
return (boolean) in_array($word, $this->rules['countable']);
return in_array($word, $this->rules['countable']);
}
/**

View File

@ -9,28 +9,7 @@
namespace Joomla\String;
// PHP mbstring and iconv local configuration
if (version_compare(PHP_VERSION, '5.6', '>='))
{
@ini_set('default_charset', 'UTF-8');
}
else
{
// Check if mbstring extension is loaded and attempt to load it if not present except for windows
if (extension_loaded('mbstring'))
{
@ini_set('mbstring.internal_encoding', 'UTF-8');
@ini_set('mbstring.http_input', 'UTF-8');
@ini_set('mbstring.http_output', 'UTF-8');
}
// Same for iconv
if (function_exists('iconv'))
{
iconv_set_encoding('internal_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');
}
}
@ini_set('default_charset', 'UTF-8');
/**
* String handling class for UTF-8 data wrapping the phputf8 library. All functions assume the validity of UTF-8 strings.

View File

@ -267,7 +267,7 @@ abstract class AbstractUri implements UriInterface
*/
public function getPort()
{
return (isset($this->port)) ? $this->port : null;
return $this->port;
}
/**
@ -303,7 +303,7 @@ abstract class AbstractUri implements UriInterface
*/
public function isSsl()
{
return $this->getScheme() == 'https';
return strtolower($this->getScheme()) === 'https';
}
/**

View File

@ -29,7 +29,7 @@ class Uri extends AbstractUri
*/
public function setVar($name, $value)
{
$tmp = isset($this->vars[$name]) ? $this->vars[$name] : null;
$tmp = $this->vars[$name] ?? null;
$this->vars[$name] = $value;

View File

@ -305,42 +305,7 @@ final class ArrayHelper
*/
public static function getColumn(array $array, $valueCol, $keyCol = null)
{
// As of PHP 7, array_column() supports an array of objects so we'll use that
if (PHP_VERSION_ID >= 70000)
{
return array_column($array, $valueCol, $keyCol);
}
$result = [];
foreach ($array as $item)
{
// Convert object to array
$subject = is_object($item) ? static::fromObject($item) : $item;
/*
* We process arrays (and objects already converted to array)
* Only if the value column (if required) exists in this item
*/
if (is_array($subject) && (!isset($valueCol) || isset($subject[$valueCol])))
{
// Use whole $item if valueCol is null, else use the value column.
$value = isset($valueCol) ? $subject[$valueCol] : $item;
// Array keys can only be integer or string. Casting will occur as per the PHP Manual.
if (isset($keyCol) && isset($subject[$keyCol]) && is_scalar($subject[$keyCol]))
{
$key = $subject[$keyCol];
$result[$key] = $value;
}
else
{
$result[] = $value;
}
}
}
return $result;
return array_column($array, $valueCol, $keyCol);
}
/**
@ -728,20 +693,60 @@ final class ArrayHelper
$array = get_object_vars($array);
}
$result = [];
foreach ($array as $k => $v)
{
$key = $prefix ? $prefix . $separator . $k : $k;
if (is_object($v) || is_array($v))
{
$array = array_merge($array, static::flatten($v, $separator, $key));
$result[] = static::flatten($v, $separator, $key);
}
else
{
$array[$key] = $v;
$result[] = [$key => $v];
}
}
return $array;
return array_merge(...$result);
}
/**
* Merge array recursively.
*
* @param array $args Array list to be merge.
*
* @return array Merged array.
*
* @throws \InvalidArgumentException
*
* @since __DEPLOY_VERSION__
*/
public static function mergeRecursive(...$args): array
{
$result = [];
foreach ($args as $i => $array)
{
if (!is_array($array))
{
throw new \InvalidArgumentException(sprintf('Argument #%d is not an array.', $i + 2));
}
foreach ($array as $key => &$value)
{
if (is_array($value) && isset($result[$key]) && is_array($result[$key]))
{
$result[$key] = static::mergeRecursive($result [$key], $value);
}
else
{
$result[$key] = $value;
}
}
}
return $result;
}
}

View File

@ -38,9 +38,10 @@ if (!is_callable('RandomCompat_intval')) {
* through.
*
* @param int|float $number The number we want to convert to an int
* @param boolean $fail_open Set to true to not throw an exception
* @param bool $fail_open Set to true to not throw an exception
*
* @return float|int
* @psalm-suppress InvalidReturnType
*
* @throws TypeError
*/

View File

@ -70,10 +70,10 @@ if (!is_callable('random_bytes')) {
$n = ($bytes - $i) > 1073741824
? 1073741824
: $bytes - $i;
$buf .= Sodium::randombytes_buf($n);
$buf .= Sodium::randombytes_buf((int) $n);
}
} else {
$buf .= Sodium::randombytes_buf($bytes);
$buf .= Sodium::randombytes_buf((int) $bytes);
}
if (is_string($buf)) {

View File

@ -78,7 +78,7 @@ if (!is_callable('random_int')) {
}
if ($max === $min) {
return $min;
return (int) $min;
}
/**
@ -185,6 +185,6 @@ if (!is_callable('random_int')) {
*/
} while (!is_int($val) || $val > $max || $val < $min);
return (int)$val;
return (int) $val;
}
}

View File

@ -94,7 +94,13 @@ if (!is_callable('sodium_crypto_aead_chacha20poly1305_decrypt')) {
*/
function sodium_crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_aead_chacha20poly1305_encrypt')) {
@ -120,7 +126,13 @@ if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_decrypt')) {
*/
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_encrypt')) {
@ -136,6 +148,38 @@ if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_encrypt')) {
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);
}
}
if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {
/**
* @param string $message
* @param string $assocData
* @param string $nonce
* @param string $key
* @return string
*/
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
{
try {
return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) {
/**
* @param string $message
* @param string $assocData
* @param string $nonce
* @param string $key
* @return string
*/
function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);
}
}
if (!is_callable('sodium_crypto_auth')) {
/**
* @param string $message
@ -196,11 +240,17 @@ if (!is_callable('sodium_crypto_box_open')) {
* @param string $message
* @param string $nonce
* @param string $kp
* @return string
* @return string|bool
*/
function sodium_crypto_box_open($message, $nonce, $kp)
{
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
try {
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_box_publickey')) {
@ -238,11 +288,17 @@ if (!is_callable('sodium_crypto_box_seal_open')) {
/**
* @param string $message
* @param string $kp
* @return string
* @return string|bool
*/
function sodium_crypto_box_seal_open($message, $kp)
{
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
try {
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_box_secretkey')) {
@ -440,11 +496,17 @@ if (!is_callable('sodium_crypto_secretbox_open')) {
* @param string $message
* @param string $nonce
* @param string $key
* @return string
* @return string|bool
*/
function sodium_crypto_secretbox_open($message, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_shorthash')) {
@ -493,11 +555,17 @@ if (!is_callable('sodium_crypto_sign_open')) {
/**
* @param string $signedMessage
* @param string $pk
* @return string
* @return string|bool
*/
function sodium_crypto_sign_open($signedMessage, $pk)
{
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
try {
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('sodium_crypto_sign_publickey')) {

View File

@ -37,11 +37,17 @@ if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_decrypt')) {
* @param string $assocData
* @param string $nonce
* @param string $key
* @return string
* @return string|bool
*/
function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_encrypt')) {
@ -63,11 +69,17 @@ if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt')) {
* @param string $assocData
* @param string $nonce
* @param string $key
* @return string
* @return string|bool
*/
function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_encrypt')) {
@ -143,11 +155,17 @@ if (!is_callable('\\Sodium\\crypto_box_open')) {
* @param string $message
* @param string $nonce
* @param string $kp
* @return string
* @return string|bool
*/
function crypto_box_open($message, $nonce, $kp)
{
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
try {
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_box_publickey')) {
@ -185,11 +203,17 @@ if (!is_callable('\\Sodium\\crypto_box_seal_open')) {
/**
* @param string $message
* @param string $kp
* @return string
* @return string|bool
*/
function crypto_box_seal_open($message, $kp)
{
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
try {
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
} catch (\Error $ex) {
return false;
} catch (\Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_box_secretkey')) {
@ -377,11 +401,17 @@ if (!is_callable('\\Sodium\\crypto_secretbox_open')) {
* @param string $message
* @param string $nonce
* @param string $key
* @return string
* @return string|bool
*/
function crypto_secretbox_open($message, $nonce, $key)
{
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
try {
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_shorthash')) {
@ -430,11 +460,17 @@ if (!is_callable('\\Sodium\\crypto_sign_open')) {
/**
* @param string $signedMessage
* @param string $pk
* @return string
* @return string|bool
*/
function crypto_sign_open($signedMessage, $pk)
{
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
try {
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
} catch (\Error $ex) {
return false;
} catch (\Exception $ex) {
return false;
}
}
}
if (!is_callable('\\Sodium\\crypto_sign_publickey')) {

View File

@ -725,7 +725,7 @@ class ParagonIE_Sodium_Compat
* This validates ciphertext integrity.
*
* @param string $ciphertext Sealed message to be opened
* @param string $keypair Your crypto_box keypair
* @param string $keypair Your crypto_box keypair
* @return string The original plaintext message
* @throws Error
* @throws TypeError
@ -1160,12 +1160,14 @@ class ParagonIE_Sodium_Compat
}
if (self::isPhp72OrGreater()) {
return sodium_crypto_kx(
$my_secret,
$their_public,
$client_public,
$server_public
);
if (is_callable('sodium_crypto_kx')) {
return sodium_crypto_kx(
$my_secret,
$their_public,
$client_public,
$server_public
);
}
}
if (self::use_fallback('crypto_kx')) {
return call_user_func(
@ -1978,7 +1980,9 @@ class ParagonIE_Sodium_Compat
throw new Error('Argument 1 must be at least CRYPTO_SIGN_SEEDBYTES long.');
}
if (self::isPhp72OrGreater()) {
return sodium_crypto_sign_ed25519_sk_to_curve25519($sk);
if (is_callable('crypto_sign_ed25519_sk_to_curve25519')) {
return sodium_crypto_sign_ed25519_sk_to_curve25519($sk);
}
}
if (self::use_fallback('crypto_sign_ed25519_sk_to_curve25519')) {
return call_user_func('\\Sodium\\crypto_sign_ed25519_sk_to_curve25519', $sk);
@ -2018,7 +2022,7 @@ class ParagonIE_Sodium_Compat
/**
* Increase a string (little endian)
*
* @param &string $var
* @param string $var
*
* @return void
* @throws Error (Unless libsodium is installed)
@ -2108,7 +2112,7 @@ class ParagonIE_Sodium_Compat
* It's actually not possible to zero memory buffers in PHP. You need the
* native library for that.
*
* @param &string $var
* @param string|null $var
*
* @return void
* @throws Error (Unless libsodium is installed)

View File

@ -128,36 +128,36 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$h9 = (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2;
$carry9 = ($h9 + (1 << 24)) >> 25;
$h0 += self::mul($carry9, 19);
$h9 -= self::mul($carry9, 1 << 25);
$h0 += self::mul($carry9, 19, 5);
$h9 -= $carry9 << 25;
$carry1 = ($h1 + (1 << 24)) >> 25;
$h2 += $carry1;
$h1 -= self::mul($carry1, 1 << 25);
$h1 -= $carry1 << 25;
$carry3 = ($h3 + (1 << 24)) >> 25;
$h4 += $carry3;
$h3 -= self::mul($carry3, 1 << 25);
$h3 -= $carry3 << 25;
$carry5 = ($h5 + (1 << 24)) >> 25;
$h6 += $carry5;
$h5 -= self::mul($carry5, 1 << 25);
$h5 -= $carry5 << 25;
$carry7 = ($h7 + (1 << 24)) >> 25;
$h8 += $carry7;
$h7 -= self::mul($carry7, 1 << 25);
$h7 -= $carry7 << 25;
$carry0 = ($h0 + (1 << 25)) >> 26;
$h1 += $carry0;
$h0 -= self::mul($carry0, 1 << 26);
$h0 -= $carry0 << 26;
$carry2 = ($h2 + (1 << 25)) >> 26;
$h3 += $carry2;
$h2 -= self::mul($carry2, 1 << 26);
$h2 -= $carry2 << 26;
$carry4 = ($h4 + (1 << 25)) >> 26;
$h5 += $carry4;
$h4 -= self::mul($carry4, 1 << 26);
$h4 -= $carry4 << 26;
$carry6 = ($h6 + (1 << 25)) >> 26;
$h7 += $carry6;
$h6 -= self::mul($carry6, 1 << 26);
$h6 -= $carry6 << 26;
$carry8 = ($h8 + (1 << 25)) >> 26;
$h9 += $carry8;
$h8 -= self::mul($carry8, 1 << 26);
$h8 -= $carry8 << 26;
return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(
array(
@ -196,7 +196,7 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$h[8] = (int) $h[8];
$h[9] = (int) $h[9];
$q = (self::mul(19, $h[9]) + (1 << 24)) >> 25;
$q = (self::mul($h[9], 19, 5) + (1 << 24)) >> 25;
$q = ($h[0] + $q) >> 26;
$q = ($h[1] + $q) >> 25;
$q = ($h[2] + $q) >> 26;
@ -208,7 +208,7 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$q = ($h[8] + $q) >> 26;
$q = ($h[9] + $q) >> 25;
$h[0] += self::mul(19, $q);
$h[0] += self::mul($q, 19, 5);
$carry0 = $h[0] >> 26;
$h[1] += $carry0;
@ -350,15 +350,15 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$g7 = $g[7];
$g8 = $g[8];
$g9 = $g[9];
$g1_19 = self::mul(19, $g1);
$g2_19 = self::mul(19, $g2);
$g3_19 = self::mul(19, $g3);
$g4_19 = self::mul(19, $g4);
$g5_19 = self::mul(19, $g5);
$g6_19 = self::mul(19, $g6);
$g7_19 = self::mul(19, $g7);
$g8_19 = self::mul(19, $g8);
$g9_19 = self::mul(19, $g9);
$g1_19 = self::mul($g1, 19, 5);
$g2_19 = self::mul($g2, 19, 5);
$g3_19 = self::mul($g3, 19, 5);
$g4_19 = self::mul($g4, 19, 5);
$g5_19 = self::mul($g5, 19, 5);
$g6_19 = self::mul($g6, 19, 5);
$g7_19 = self::mul($g7, 19, 5);
$g8_19 = self::mul($g8, 19, 5);
$g9_19 = self::mul($g9, 19, 5);
$f1_2 = $f1 << 1;
$f3_2 = $f3 << 1;
$f5_2 = $f5 << 1;
@ -511,7 +511,7 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$h8 -= $carry8 << 26;
$carry9 = ($h9 + (1 << 24)) >> 25;
$h0 += self::mul($carry9, 19);
$h0 += self::mul($carry9, 19, 5);
$h9 -= $carry9 << 25;
$carry0 = ($h0 + (1 << 25)) >> 26;
@ -584,11 +584,11 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$f5_2 = $f5 << 1;
$f6_2 = $f6 << 1;
$f7_2 = $f7 << 1;
$f5_38 = self::mul(38, $f5);
$f6_19 = self::mul(19, $f6);
$f7_38 = self::mul(38, $f7);
$f8_19 = self::mul(19, $f8);
$f9_38 = self::mul(38, $f9);
$f5_38 = self::mul($f5, 38, 6);
$f6_19 = self::mul($f6, 19, 5);
$f7_38 = self::mul($f7, 38, 6);
$f8_19 = self::mul($f8, 19, 5);
$f9_38 = self::mul($f9, 38, 6);
$f0f0 = self::mul($f0, $f0);
$f0f1_2 = self::mul($f0_2, $f1);
$f0f2_2 = self::mul($f0_2, $f2);
@ -691,7 +691,7 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$h8 -= $carry8 << 26;
$carry9 = ($h9 + (1 << 24)) >> 25;
$h0 += self::mul($carry9, 19);
$h0 += self::mul($carry9, 19, 5);
$h9 -= $carry9 << 25;
$carry0 = ($h0 + (1 << 25)) >> 26;
@ -746,11 +746,11 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$f5_2 = $f5 << 1;
$f6_2 = $f6 << 1;
$f7_2 = $f7 << 1;
$f5_38 = self::mul(38, $f5); /* 1.959375*2^30 */
$f6_19 = self::mul(19, $f6); /* 1.959375*2^30 */
$f7_38 = self::mul(38, $f7); /* 1.959375*2^30 */
$f8_19 = self::mul(19, $f8); /* 1.959375*2^30 */
$f9_38 = self::mul(38, $f9); /* 1.959375*2^30 */
$f5_38 = self::mul($f5, 38, 6); /* 1.959375*2^30 */
$f6_19 = self::mul($f6, 19, 5); /* 1.959375*2^30 */
$f7_38 = self::mul($f7, 38, 6); /* 1.959375*2^30 */
$f8_19 = self::mul($f8, 19, 5); /* 1.959375*2^30 */
$f9_38 = self::mul($f9, 38, 6); /* 1.959375*2^30 */
$f0f0 = self::mul($f0, (int) $f0);
$f0f1_2 = self::mul($f0_2, (int) $f1);
$f0f2_2 = self::mul($f0_2, (int) $f2);
@ -865,7 +865,7 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$h8 -= $carry8 << 26;
$carry9 = ($h9 + (1 << 24)) >> 25;
$h0 += self::mul($carry9, 19);
$h0 += self::mul($carry9, 19, 5);
$h9 -= $carry9 << 25;
$carry0 = ($h0 + (1 << 25)) >> 26;
@ -1892,320 +1892,318 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$carry0 = ($s0 + (1 << 20)) >> 21;
$s1 += $carry0;
$s0 -= self::mul($carry0, 1 << 21);
$s0 -= $carry0 << 21;
$carry2 = ($s2 + (1 << 20)) >> 21;
$s3 += $carry2;
$s2 -= self::mul($carry2, 1 << 21);
$s2 -= $carry2 << 21;
$carry4 = ($s4 + (1 << 20)) >> 21;
$s5 += $carry4;
$s4 -= self::mul($carry4, 1 << 21);
$s4 -= $carry4 << 21;
$carry6 = ($s6 + (1 << 20)) >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry8 = ($s8 + (1 << 20)) >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry10 = ($s10 + (1 << 20)) >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry12 = ($s12 + (1 << 20)) >> 21;
$s13 += $carry12;
$s12 -= self::mul($carry12, 1 << 21);
$s12 -= $carry12 << 21;
$carry14 = ($s14 + (1 << 20)) >> 21;
$s15 += $carry14;
$s14 -= self::mul($carry14, 1 << 21);
$s14 -= $carry14 << 21;
$carry16 = ($s16 + (1 << 20)) >> 21;
$s17 += $carry16;
$s16 -= self::mul($carry16, 1 << 21);
$s16 -= $carry16 << 21;
$carry18 = ($s18 + (1 << 20)) >> 21;
$s19 += $carry18;
$s18 -= self::mul($carry18, 1 << 21);
$s18 -= $carry18 << 21;
$carry20 = ($s20 + (1 << 20)) >> 21;
$s21 += $carry20;
$s20 -= self::mul($carry20, 1 << 21);
$s20 -= $carry20 << 21;
$carry22 = ($s22 + (1 << 20)) >> 21;
$s23 += $carry22;
$s22 -= self::mul($carry22, 1 << 21);
$s22 -= $carry22 << 21;
$carry1 = ($s1 + (1 << 20)) >> 21;
$s2 += $carry1;
$s1 -= self::mul($carry1, 1 << 21);
$s1 -= $carry1 << 21;
$carry3 = ($s3 + (1 << 20)) >> 21;
$s4 += $carry3;
$s3 -= self::mul($carry3, 1 << 21);
$s3 -= $carry3 << 21;
$carry5 = ($s5 + (1 << 20)) >> 21;
$s6 += $carry5;
$s5 -= self::mul($carry5, 1 << 21);
$s5 -= $carry5 << 21;
$carry7 = ($s7 + (1 << 20)) >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry9 = ($s9 + (1 << 20)) >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry11 = ($s11 + (1 << 20)) >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$carry13 = ($s13 + (1 << 20)) >> 21;
$s14 += $carry13;
$s13 -= self::mul($carry13, 1 << 21);
$s13 -= $carry13 << 21;
$carry15 = ($s15 + (1 << 20)) >> 21;
$s16 += $carry15;
$s15 -= self::mul($carry15, 1 << 21);
$s15 -= $carry15 << 21;
$carry17 = ($s17 + (1 << 20)) >> 21;
$s18 += $carry17;
$s17 -= self::mul($carry17, 1 << 21);
$s17 -= $carry17 << 21;
$carry19 = ($s19 + (1 << 20)) >> 21;
$s20 += $carry19;
$s19 -= self::mul($carry19, 1 << 21);
$s19 -= $carry19 << 21;
$carry21 = ($s21 + (1 << 20)) >> 21;
$s22 += $carry21;
$s21 -= self::mul($carry21, 1 << 21);
$s21 -= $carry21 << 21;
$s11 += self::mul($s23, 666643);
$s12 += self::mul($s23, 470296);
$s13 += self::mul($s23, 654183);
$s14 -= self::mul($s23, 997805);
$s15 += self::mul($s23, 136657);
$s16 -= self::mul($s23, 683901);
$s11 += self::mul($s23, 666643, 20);
$s12 += self::mul($s23, 470296, 19);
$s13 += self::mul($s23, 654183, 20);
$s14 -= self::mul($s23, 997805, 20);
$s15 += self::mul($s23, 136657, 18);
$s16 -= self::mul($s23, 683901, 20);
$s10 += self::mul($s22, 666643);
$s11 += self::mul($s22, 470296);
$s12 += self::mul($s22, 654183);
$s13 -= self::mul($s22, 997805);
$s14 += self::mul($s22, 136657);
$s15 -= self::mul($s22, 683901);
$s10 += self::mul($s22, 666643, 20);
$s11 += self::mul($s22, 470296, 19);
$s12 += self::mul($s22, 654183, 20);
$s13 -= self::mul($s22, 997805, 20);
$s14 += self::mul($s22, 136657, 18);
$s15 -= self::mul($s22, 683901, 20);
$s9 += self::mul($s21, 666643);
$s10 += self::mul($s21, 470296);
$s11 += self::mul($s21, 654183);
$s12 -= self::mul($s21, 997805);
$s13 += self::mul($s21, 136657);
$s14 -= self::mul($s21, 683901);
$s9 += self::mul($s21, 666643, 20);
$s10 += self::mul($s21, 470296, 19);
$s11 += self::mul($s21, 654183, 20);
$s12 -= self::mul($s21, 997805, 20);
$s13 += self::mul($s21, 136657, 18);
$s14 -= self::mul($s21, 683901, 20);
$s8 += self::mul($s20, 666643);
$s9 += self::mul($s20, 470296);
$s10 += self::mul($s20, 654183);
$s11 -= self::mul($s20, 997805);
$s12 += self::mul($s20, 136657);
$s13 -= self::mul($s20, 683901);
$s8 += self::mul($s20, 666643, 20);
$s9 += self::mul($s20, 470296, 19);
$s10 += self::mul($s20, 654183, 20);
$s11 -= self::mul($s20, 997805, 20);
$s12 += self::mul($s20, 136657, 18);
$s13 -= self::mul($s20, 683901, 20);
$s7 += self::mul($s19, 666643);
$s8 += self::mul($s19, 470296);
$s9 += self::mul($s19, 654183);
$s10 -= self::mul($s19, 997805);
$s11 += self::mul($s19, 136657);
$s12 -= self::mul($s19, 683901);
$s7 += self::mul($s19, 666643, 20);
$s8 += self::mul($s19, 470296, 19);
$s9 += self::mul($s19, 654183, 20);
$s10 -= self::mul($s19, 997805, 20);
$s11 += self::mul($s19, 136657, 18);
$s12 -= self::mul($s19, 683901, 20);
$s6 += self::mul($s18, 666643);
$s7 += self::mul($s18, 470296);
$s8 += self::mul($s18, 654183);
$s9 -= self::mul($s18, 997805);
$s10 += self::mul($s18, 136657);
$s11 -= self::mul($s18, 683901);
$s6 += self::mul($s18, 666643, 20);
$s7 += self::mul($s18, 470296, 19);
$s8 += self::mul($s18, 654183, 20);
$s9 -= self::mul($s18, 997805, 20);
$s10 += self::mul($s18, 136657, 18);
$s11 -= self::mul($s18, 683901, 20);
$carry6 = ($s6 + (1 << 20)) >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry8 = ($s8 + (1 << 20)) >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry10 = ($s10 + (1 << 20)) >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry12 = ($s12 + (1 << 20)) >> 21;
$s13 += $carry12;
$s12 -= self::mul($carry12, 1 << 21);
$s12 -= $carry12 << 21;
$carry14 = ($s14 + (1 << 20)) >> 21;
$s15 += $carry14;
$s14 -= self::mul($carry14, 1 << 21);
$s14 -= $carry14 << 21;
$carry16 = ($s16 + (1 << 20)) >> 21;
$s17 += $carry16;
$s16 -= self::mul($carry16, 1 << 21);
$s16 -= $carry16 << 21;
$carry7 = ($s7 + (1 << 20)) >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry9 = ($s9 + (1 << 20)) >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry11 = ($s11 + (1 << 20)) >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$carry13 = ($s13 + (1 << 20)) >> 21;
$s14 += $carry13;
$s13 -= self::mul($carry13, 1 << 21);
$s13 -= $carry13 << 21;
$carry15 = ($s15 + (1 << 20)) >> 21;
$s16 += $carry15;
$s15 -= self::mul($carry15, 1 << 21);
$s15 -= $carry15 << 21;
$s5 += self::mul($s17, 666643);
$s6 += self::mul($s17, 470296);
$s7 += self::mul($s17, 654183);
$s8 -= self::mul($s17, 997805);
$s9 += self::mul($s17, 136657);
$s10 -= self::mul($s17, 683901);
$s5 += self::mul($s17, 666643, 20);
$s6 += self::mul($s17, 470296, 19);
$s7 += self::mul($s17, 654183, 20);
$s8 -= self::mul($s17, 997805, 20);
$s9 += self::mul($s17, 136657, 18);
$s10 -= self::mul($s17, 683901, 20);
$s4 += self::mul($s16, 666643);
$s5 += self::mul($s16, 470296);
$s6 += self::mul($s16, 654183);
$s7 -= self::mul($s16, 997805);
$s8 += self::mul($s16, 136657);
$s9 -= self::mul($s16, 683901);
$s4 += self::mul($s16, 666643, 20);
$s5 += self::mul($s16, 470296, 19);
$s6 += self::mul($s16, 654183, 20);
$s7 -= self::mul($s16, 997805, 20);
$s8 += self::mul($s16, 136657, 18);
$s9 -= self::mul($s16, 683901, 20);
$s3 += self::mul($s15, 666643);
$s4 += self::mul($s15, 470296);
$s5 += self::mul($s15, 654183);
$s6 -= self::mul($s15, 997805);
$s7 += self::mul($s15, 136657);
$s8 -= self::mul($s15, 683901);
$s3 += self::mul($s15, 666643, 20);
$s4 += self::mul($s15, 470296, 19);
$s5 += self::mul($s15, 654183, 20);
$s6 -= self::mul($s15, 997805, 20);
$s7 += self::mul($s15, 136657, 18);
$s8 -= self::mul($s15, 683901, 20);
$s2 += self::mul($s14, 666643);
$s3 += self::mul($s14, 470296);
$s4 += self::mul($s14, 654183);
$s5 -= self::mul($s14, 997805);
$s6 += self::mul($s14, 136657);
$s7 -= self::mul($s14, 683901);
$s2 += self::mul($s14, 666643, 20);
$s3 += self::mul($s14, 470296, 19);
$s4 += self::mul($s14, 654183, 20);
$s5 -= self::mul($s14, 997805, 20);
$s6 += self::mul($s14, 136657, 18);
$s7 -= self::mul($s14, 683901, 20);
$s1 += self::mul($s13, 666643);
$s2 += self::mul($s13, 470296);
$s3 += self::mul($s13, 654183);
$s4 -= self::mul($s13, 997805);
$s5 += self::mul($s13, 136657);
$s6 -= self::mul($s13, 683901);
$s1 += self::mul($s13, 666643, 20);
$s2 += self::mul($s13, 470296, 19);
$s3 += self::mul($s13, 654183, 20);
$s4 -= self::mul($s13, 997805, 20);
$s5 += self::mul($s13, 136657, 18);
$s6 -= self::mul($s13, 683901, 20);
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$s12 = 0;
$carry0 = ($s0 + (1 << 20)) >> 21;
$s1 += $carry0;
$s0 -= self::mul($carry0, 1 << 21);
$s0 -= $carry0 << 21;
$carry2 = ($s2 + (1 << 20)) >> 21;
$s3 += $carry2;
$s2 -= self::mul($carry2, 1 << 21);
$s2 -= $carry2 << 21;
$carry4 = ($s4 + (1 << 20)) >> 21;
$s5 += $carry4;
$s4 -= self::mul($carry4, 1 << 21);
$s4 -= $carry4 << 21;
$carry6 = ($s6 + (1 << 20)) >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry8 = ($s8 + (1 << 20)) >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry10 = ($s10 + (1 << 20)) >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry1 = ($s1 + (1 << 20)) >> 21;
$s2 += $carry1;
$s1 -= self::mul($carry1, 1 << 21);
$s1 -= $carry1 << 21;
$carry3 = ($s3 + (1 << 20)) >> 21;
$s4 += $carry3;
$s3 -= self::mul($carry3, 1 << 21);
$s3 -= $carry3 << 21;
$carry5 = ($s5 + (1 << 20)) >> 21;
$s6 += $carry5;
$s5 -= self::mul($carry5, 1 << 21);
$s5 -= $carry5 << 21;
$carry7 = ($s7 + (1 << 20)) >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry9 = ($s9 + (1 << 20)) >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry11 = ($s11 + (1 << 20)) >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$s12 = 0;
$carry0 = $s0 >> 21;
$s1 += $carry0;
$s0 -= self::mul($carry0, 1 << 21);
$s0 -= $carry0 << 21;
$carry1 = $s1 >> 21;
$s2 += $carry1;
$s1 -= self::mul($carry1, 1 << 21);
$s1 -= $carry1 << 21;
$carry2 = $s2 >> 21;
$s3 += $carry2;
$s2 -= self::mul($carry2, 1 << 21);
$s2 -= $carry2 << 21;
$carry3 = $s3 >> 21;
$s4 += $carry3;
$s3 -= self::mul($carry3, 1 << 21);
$s3 -= $carry3 << 21;
$carry4 = $s4 >> 21;
$s5 += $carry4;
$s4 -= self::mul($carry4, 1 << 21);
$s4 -= $carry4 << 21;
$carry5 = $s5 >> 21;
$s6 += $carry5;
$s5 -= self::mul($carry5, 1 << 21);
$s5 -= $carry5 << 21;
$carry6 = $s6 >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry7 = $s7 >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry8 = $s8 >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry9 = $s9 >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry10 = $s10 >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry11 = $s11 >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$carry0 = $s0 >> 21;
$s1 += $carry0;
$s0 -= self::mul($carry0, 1 << 21);
$s0 -= $carry0 << 21;
$carry1 = $s1 >> 21;
$s2 += $carry1;
$s1 -= self::mul($carry1, 1 << 21);
$s1 -= $carry1 << 21;
$carry2 = $s2 >> 21;
$s3 += $carry2;
$s2 -= self::mul($carry2, 1 << 21);
$s2 -= $carry2 << 21;
$carry3 = $s3 >> 21;
$s4 += $carry3;
$s3 -= self::mul($carry3, 1 << 21);
$s3 -= $carry3 << 21;
$carry4 = $s4 >> 21;
$s5 += $carry4;
$s4 -= self::mul($carry4, 1 << 21);
$s4 -= $carry4 << 21;
$carry5 = $s5 >> 21;
$s6 += $carry5;
$s5 -= self::mul($carry5, 1 << 21);
$s5 -= $carry5 << 21;
$carry6 = $s6 >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry7 = $s7 >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry8 = $s8 >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry9 = $s9 >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry10 = $s10 >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
/**
* @var array<int, int>
@ -2213,33 +2211,33 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$arr = array(
(int) (0xff & ($s0 >> 0)),
(int) (0xff & ($s0 >> 8)),
(int) (0xff & (($s0 >> 16) | self::mul($s1, 1 << 5))),
(int) (0xff & (($s0 >> 16) | $s1 << 5)),
(int) (0xff & ($s1 >> 3)),
(int) (0xff & ($s1 >> 11)),
(int) (0xff & (($s1 >> 19) | self::mul($s2, 1 << 2))),
(int) (0xff & (($s1 >> 19) | $s2 << 2)),
(int) (0xff & ($s2 >> 6)),
(int) (0xff & (($s2 >> 14) | self::mul($s3, 1 << 7))),
(int) (0xff & (($s2 >> 14) | $s3 << 7)),
(int) (0xff & ($s3 >> 1)),
(int) (0xff & ($s3 >> 9)),
(int) (0xff & (($s3 >> 17) | self::mul($s4, 1 << 4))),
(int) (0xff & (($s3 >> 17) | $s4 << 4)),
(int) (0xff & ($s4 >> 4)),
(int) (0xff & ($s4 >> 12)),
(int) (0xff & (($s4 >> 20) | self::mul($s5, 1 << 1))),
(int) (0xff & (($s4 >> 20) | $s5 << 1)),
(int) (0xff & ($s5 >> 7)),
(int) (0xff & (($s5 >> 15) | self::mul($s6, 1 << 6))),
(int) (0xff & (($s5 >> 15) | $s6 << 6)),
(int) (0xff & ($s6 >> 2)),
(int) (0xff & ($s6 >> 10)),
(int) (0xff & (($s6 >> 18) | self::mul($s7, 1 << 3))),
(int) (0xff & (($s6 >> 18) | $s7 << 3)),
(int) (0xff & ($s7 >> 5)),
(int) (0xff & ($s7 >> 13)),
(int) (0xff & ($s8 >> 0)),
(int) (0xff & ($s8 >> 8)),
(int) (0xff & (($s8 >> 16) | self::mul($s9, 1 << 5))),
(int) (0xff & (($s8 >> 16) | $s9 << 5)),
(int) (0xff & ($s9 >> 3)),
(int) (0xff & ($s9 >> 11)),
(int) (0xff & (($s9 >> 19) | self::mul($s10, 1 << 2))),
(int) (0xff & (($s9 >> 19) | $s10 << 2)),
(int) (0xff & ($s10 >> 6)),
(int) (0xff & (($s10 >> 14) | self::mul($s11, 1 << 7))),
(int) (0xff & (($s10 >> 14) | $s11 << 7)),
(int) (0xff & ($s11 >> 1)),
(int) (0xff & ($s11 >> 9)),
0xff & ($s11 >> 17)
@ -2280,170 +2278,170 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$s22 = 2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6);
$s23 = (self::load_4(self::substr($s, 60, 4)) >> 3);
$s11 += self::mul($s23, 666643);
$s12 += self::mul($s23, 470296);
$s13 += self::mul($s23, 654183);
$s14 -= self::mul($s23, 997805);
$s15 += self::mul($s23, 136657);
$s16 -= self::mul($s23, 683901);
$s11 += self::mul($s23, 666643, 20);
$s12 += self::mul($s23, 470296, 19);
$s13 += self::mul($s23, 654183, 20);
$s14 -= self::mul($s23, 997805, 20);
$s15 += self::mul($s23, 136657, 18);
$s16 -= self::mul($s23, 683901, 20);
$s10 += self::mul($s22, 666643);
$s11 += self::mul($s22, 470296);
$s12 += self::mul($s22, 654183);
$s13 -= self::mul($s22, 997805);
$s14 += self::mul($s22, 136657);
$s15 -= self::mul($s22, 683901);
$s10 += self::mul($s22, 666643, 20);
$s11 += self::mul($s22, 470296, 19);
$s12 += self::mul($s22, 654183, 20);
$s13 -= self::mul($s22, 997805, 20);
$s14 += self::mul($s22, 136657, 18);
$s15 -= self::mul($s22, 683901, 20);
$s9 += self::mul($s21, 666643);
$s10 += self::mul($s21, 470296);
$s11 += self::mul($s21, 654183);
$s12 -= self::mul($s21, 997805);
$s13 += self::mul($s21, 136657);
$s14 -= self::mul($s21, 683901);
$s9 += self::mul($s21, 666643, 20);
$s10 += self::mul($s21, 470296, 19);
$s11 += self::mul($s21, 654183, 20);
$s12 -= self::mul($s21, 997805, 20);
$s13 += self::mul($s21, 136657, 18);
$s14 -= self::mul($s21, 683901, 20);
$s8 += self::mul($s20, 666643);
$s9 += self::mul($s20, 470296);
$s10 += self::mul($s20, 654183);
$s11 -= self::mul($s20, 997805);
$s12 += self::mul($s20, 136657);
$s13 -= self::mul($s20, 683901);
$s8 += self::mul($s20, 666643, 20);
$s9 += self::mul($s20, 470296, 19);
$s10 += self::mul($s20, 654183, 20);
$s11 -= self::mul($s20, 997805, 20);
$s12 += self::mul($s20, 136657, 18);
$s13 -= self::mul($s20, 683901, 20);
$s7 += self::mul($s19, 666643);
$s8 += self::mul($s19, 470296);
$s9 += self::mul($s19, 654183);
$s10 -= self::mul($s19, 997805);
$s11 += self::mul($s19, 136657);
$s12 -= self::mul($s19, 683901);
$s7 += self::mul($s19, 666643, 20);
$s8 += self::mul($s19, 470296, 19);
$s9 += self::mul($s19, 654183, 20);
$s10 -= self::mul($s19, 997805, 20);
$s11 += self::mul($s19, 136657, 18);
$s12 -= self::mul($s19, 683901, 20);
$s6 += self::mul($s18, 666643);
$s7 += self::mul($s18, 470296);
$s8 += self::mul($s18, 654183);
$s9 -= self::mul($s18, 997805);
$s10 += self::mul($s18, 136657);
$s11 -= self::mul($s18, 683901);
$s6 += self::mul($s18, 666643, 20);
$s7 += self::mul($s18, 470296, 19);
$s8 += self::mul($s18, 654183, 20);
$s9 -= self::mul($s18, 997805, 20);
$s10 += self::mul($s18, 136657, 18);
$s11 -= self::mul($s18, 683901, 20);
$carry6 = ($s6 + (1 << 20)) >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry8 = ($s8 + (1 << 20)) >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry10 = ($s10 + (1 << 20)) >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry12 = ($s12 + (1 << 20)) >> 21;
$s13 += $carry12;
$s12 -= self::mul($carry12, 1 << 21);
$s12 -= $carry12 << 21;
$carry14 = ($s14 + (1 << 20)) >> 21;
$s15 += $carry14;
$s14 -= self::mul($carry14, 1 << 21);
$s14 -= $carry14 << 21;
$carry16 = ($s16 + (1 << 20)) >> 21;
$s17 += $carry16;
$s16 -= self::mul($carry16, 1 << 21);
$s16 -= $carry16 << 21;
$carry7 = ($s7 + (1 << 20)) >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry9 = ($s9 + (1 << 20)) >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry11 = ($s11 + (1 << 20)) >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$carry13 = ($s13 + (1 << 20)) >> 21;
$s14 += $carry13;
$s13 -= self::mul($carry13, 1 << 21);
$s13 -= $carry13 << 21;
$carry15 = ($s15 + (1 << 20)) >> 21;
$s16 += $carry15;
$s15 -= self::mul($carry15, 1 << 21);
$s15 -= $carry15 << 21;
$s5 += self::mul($s17, 666643);
$s6 += self::mul($s17, 470296);
$s7 += self::mul($s17, 654183);
$s8 -= self::mul($s17, 997805);
$s9 += self::mul($s17, 136657);
$s10 -= self::mul($s17, 683901);
$s5 += self::mul($s17, 666643, 20);
$s6 += self::mul($s17, 470296, 19);
$s7 += self::mul($s17, 654183, 20);
$s8 -= self::mul($s17, 997805, 20);
$s9 += self::mul($s17, 136657, 18);
$s10 -= self::mul($s17, 683901, 20);
$s4 += self::mul($s16, 666643);
$s5 += self::mul($s16, 470296);
$s6 += self::mul($s16, 654183);
$s7 -= self::mul($s16, 997805);
$s8 += self::mul($s16, 136657);
$s9 -= self::mul($s16, 683901);
$s4 += self::mul($s16, 666643, 20);
$s5 += self::mul($s16, 470296, 19);
$s6 += self::mul($s16, 654183, 20);
$s7 -= self::mul($s16, 997805, 20);
$s8 += self::mul($s16, 136657, 18);
$s9 -= self::mul($s16, 683901, 20);
$s3 += self::mul($s15, 666643);
$s4 += self::mul($s15, 470296);
$s5 += self::mul($s15, 654183);
$s6 -= self::mul($s15, 997805);
$s7 += self::mul($s15, 136657);
$s8 -= self::mul($s15, 683901);
$s3 += self::mul($s15, 666643, 20);
$s4 += self::mul($s15, 470296, 19);
$s5 += self::mul($s15, 654183, 20);
$s6 -= self::mul($s15, 997805, 20);
$s7 += self::mul($s15, 136657, 18);
$s8 -= self::mul($s15, 683901, 20);
$s2 += self::mul($s14, 666643);
$s3 += self::mul($s14, 470296);
$s4 += self::mul($s14, 654183);
$s5 -= self::mul($s14, 997805);
$s6 += self::mul($s14, 136657);
$s7 -= self::mul($s14, 683901);
$s2 += self::mul($s14, 666643, 20);
$s3 += self::mul($s14, 470296, 19);
$s4 += self::mul($s14, 654183, 20);
$s5 -= self::mul($s14, 997805, 20);
$s6 += self::mul($s14, 136657, 18);
$s7 -= self::mul($s14, 683901, 20);
$s1 += self::mul($s13, 666643);
$s2 += self::mul($s13, 470296);
$s3 += self::mul($s13, 654183);
$s4 -= self::mul($s13, 997805);
$s5 += self::mul($s13, 136657);
$s6 -= self::mul($s13, 683901);
$s1 += self::mul($s13, 666643, 20);
$s2 += self::mul($s13, 470296, 19);
$s3 += self::mul($s13, 654183, 20);
$s4 -= self::mul($s13, 997805, 20);
$s5 += self::mul($s13, 136657, 18);
$s6 -= self::mul($s13, 683901, 20);
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$s12 = 0;
$carry0 = ($s0 + (1 << 20)) >> 21;
$s1 += $carry0;
$s0 -= self::mul($carry0, 1 << 21);
$s0 -= $carry0 << 21;
$carry2 = ($s2 + (1 << 20)) >> 21;
$s3 += $carry2;
$s2 -= self::mul($carry2, 1 << 21);
$s2 -= $carry2 << 21;
$carry4 = ($s4 + (1 << 20)) >> 21;
$s5 += $carry4;
$s4 -= self::mul($carry4, 1 << 21);
$s4 -= $carry4 << 21;
$carry6 = ($s6 + (1 << 20)) >> 21;
$s7 += $carry6;
$s6 -= self::mul($carry6, 1 << 21);
$s6 -= $carry6 << 21;
$carry8 = ($s8 + (1 << 20)) >> 21;
$s9 += $carry8;
$s8 -= self::mul($carry8, 1 << 21);
$s8 -= $carry8 << 21;
$carry10 = ($s10 + (1 << 20)) >> 21;
$s11 += $carry10;
$s10 -= self::mul($carry10, 1 << 21);
$s10 -= $carry10 << 21;
$carry1 = ($s1 + (1 << 20)) >> 21;
$s2 += $carry1;
$s1 -= self::mul($carry1, 1 << 21);
$s1 -= $carry1 << 21;
$carry3 = ($s3 + (1 << 20)) >> 21;
$s4 += $carry3;
$s3 -= self::mul($carry3, 1 << 21);
$s3 -= $carry3 << 21;
$carry5 = ($s5 + (1 << 20)) >> 21;
$s6 += $carry5;
$s5 -= self::mul($carry5, 1 << 21);
$s5 -= $carry5 << 21;
$carry7 = ($s7 + (1 << 20)) >> 21;
$s8 += $carry7;
$s7 -= self::mul($carry7, 1 << 21);
$s7 -= $carry7 << 21;
$carry9 = ($s9 + (1 << 20)) >> 21;
$s10 += $carry9;
$s9 -= self::mul($carry9, 1 << 21);
$s9 -= $carry9 << 21;
$carry11 = ($s11 + (1 << 20)) >> 21;
$s12 += $carry11;
$s11 -= self::mul($carry11, 1 << 21);
$s11 -= $carry11 << 21;
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$s12 = 0;
$carry0 = $s0 >> 21;
@ -2483,12 +2481,12 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$s12 += $carry11;
$s11 -= $carry11 << 21;
$s0 += self::mul($s12, 666643);
$s1 += self::mul($s12, 470296);
$s2 += self::mul($s12, 654183);
$s3 -= self::mul($s12, 997805);
$s4 += self::mul($s12, 136657);
$s5 -= self::mul($s12, 683901);
$s0 += self::mul($s12, 666643, 20);
$s1 += self::mul($s12, 470296, 19);
$s2 += self::mul($s12, 654183, 20);
$s3 -= self::mul($s12, 997805, 20);
$s4 += self::mul($s12, 136657, 18);
$s5 -= self::mul($s12, 683901, 20);
$carry0 = $s0 >> 21;
$s1 += $carry0;
@ -2530,33 +2528,33 @@ abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Cu
$arr = array(
(int) ($s0 >> 0),
(int) ($s0 >> 8),
(int) (($s0 >> 16) | self::mul($s1, 1 << 5)),
(int) (($s0 >> 16) | $s1 << 5),
(int) ($s1 >> 3),
(int) ($s1 >> 11),
(int) (($s1 >> 19) | self::mul($s2, 1 << 2)),
(int) (($s1 >> 19) | $s2 << 2),
(int) ($s2 >> 6),
(int) (($s2 >> 14) | self::mul($s3, 1 << 7)),
(int) (($s2 >> 14) | $s3 << 7),
(int) ($s3 >> 1),
(int) ($s3 >> 9),
(int) (($s3 >> 17) | self::mul($s4, 1 << 4)),
(int) (($s3 >> 17) | $s4 << 4),
(int) ($s4 >> 4),
(int) ($s4 >> 12),
(int) (($s4 >> 20) | self::mul($s5, 1 << 1)),
(int) (($s4 >> 20) | $s5 << 1),
(int) ($s5 >> 7),
(int) (($s5 >> 15) | self::mul($s6, 1 << 6)),
(int) (($s5 >> 15) | $s6 << 6),
(int) ($s6 >> 2),
(int) ($s6 >> 10),
(int) (($s6 >> 18) | self::mul($s7, 1 << 3)),
(int) (($s6 >> 18) | $s7 << 3),
(int) ($s7 >> 5),
(int) ($s7 >> 13),
(int) ($s8 >> 0),
(int) ($s8 >> 8),
(int) (($s8 >> 16) | self::mul($s9, 1 << 5)),
(int) (($s8 >> 16) | $s9 << 5),
(int) ($s9 >> 3),
(int) ($s9 >> 11),
(int) (($s9 >> 19) | self::mul($s10, 1 << 2)),
(int) (($s9 >> 19) | $s10 << 2),
(int) ($s10 >> 6),
(int) (($s10 >> 14) | self::mul($s11, 1 << 7)),
(int) (($s10 >> 14) | $s11 << 7),
(int) ($s11 >> 1),
(int) ($s11 >> 9),
(int) $s11 >> 17

View File

@ -157,10 +157,10 @@ class ParagonIE_Sodium_Core_Poly1305_State extends ParagonIE_Sodium_Core_Util
$r3 = (int) $this->r[3];
$r4 = (int) $this->r[4];
$s1 = self::mul($r1, 5);
$s2 = self::mul($r2, 5);
$s3 = self::mul($r3, 5);
$s4 = self::mul($r4, 5);
$s1 = self::mul($r1, 5, 3);
$s2 = self::mul($r2, 5, 3);
$s3 = self::mul($r3, 5, 3);
$s4 = self::mul($r4, 5, 3);
$h0 = $this->h[0];
$h1 = $this->h[1];
@ -232,7 +232,7 @@ class ParagonIE_Sodium_Core_Poly1305_State extends ParagonIE_Sodium_Core_Util
$d4 += $c;
$c = $d4 >> 26;
$h4 = $d4 & 0x3ffffff;
$h0 += (int) self::mul($c, 5);
$h0 += (int) self::mul($c, 5, 3);
$c = $h0 >> 26;
$h0 &= 0x3ffffff;
$h1 += $c;
@ -297,7 +297,7 @@ class ParagonIE_Sodium_Core_Poly1305_State extends ParagonIE_Sodium_Core_Util
$h4 += $c;
$c = $h4 >> 26;
$h4 &= 0x3ffffff;
$h0 += self::mul($c, 5);
$h0 += self::mul($c, 5, 3);
$c = $h0 >> 26;
$h0 &= 0x3ffffff;
$h1 += $c;

View File

@ -463,17 +463,22 @@ abstract class ParagonIE_Sodium_Core_Util
*
* @param int $a
* @param int $b
* @param int $size Limits the number of operations (useful for small,
* constant operands)
* @return int
*/
public static function mul($a, $b)
public static function mul($a, $b, $size = 0)
{
if (ParagonIE_Sodium_Compat::$fastMult) {
return (int) ($a * $b);
}
static $size = null;
if (!$size) {
$size = (PHP_INT_SIZE << 3) - 1;
static $defaultSize = null;
if (!$defaultSize) {
$defaultSize = (PHP_INT_SIZE << 3) - 1;
}
if ($size < 1) {
$size = $defaultSize;
}
$c = 0;

View File

@ -86,20 +86,20 @@ abstract class ParagonIE_Sodium_Core_X25519 extends ParagonIE_Sodium_Core_Curve2
public static function fe_mul121666(ParagonIE_Sodium_Core_Curve25519_Fe $f)
{
$h = array(
self::mul($f[0], 121666),
self::mul($f[1], 121666),
self::mul($f[2], 121666),
self::mul($f[3], 121666),
self::mul($f[4], 121666),
self::mul($f[5], 121666),
self::mul($f[6], 121666),
self::mul($f[7], 121666),
self::mul($f[8], 121666),
self::mul($f[9], 121666)
self::mul($f[0], 121666, 17),
self::mul($f[1], 121666, 17),
self::mul($f[2], 121666, 17),
self::mul($f[3], 121666, 17),
self::mul($f[4], 121666, 17),
self::mul($f[5], 121666, 17),
self::mul($f[6], 121666, 17),
self::mul($f[7], 121666, 17),
self::mul($f[8], 121666, 17),
self::mul($f[9], 121666, 17)
);
$carry9 = ($h[9] + (1 << 24)) >> 25;
$h[0] += self::mul($carry9, 19);
$h[0] += self::mul($carry9, 19, 5);
$h[9] -= $carry9 << 25;
$carry1 = ($h[1] + (1 << 24)) >> 25;
$h[2] += $carry1;

View File

@ -22,9 +22,16 @@ class ParagonIE_Sodium_Core32_Int32
*/
public $overflow = 0;
/**
* ParagonIE_Sodium_Core32_Int32 constructor.
* @param array $array
*/
public function __construct($array = array(0, 0))
{
$this->limbs = $array;
$this->limbs = array(
(int) $array[0],
(int) $array[1]
);
$this->overflow = 0;
}
@ -102,8 +109,8 @@ class ParagonIE_Sodium_Core32_Int32
$lo = ($m & 0xffff);
return new ParagonIE_Sodium_Core32_Int32(
array(
$this->limbs[0] & $hi,
$this->limbs[1] & $lo
(int) ($this->limbs[0] & $hi),
(int) ($this->limbs[1] & $lo)
)
);
}
@ -304,6 +311,9 @@ class ParagonIE_Sodium_Core32_Int32
} elseif ($c < 0) {
return $this->shiftLeft(-$c);
} else {
if (is_null($c)) {
throw new TypeError();
}
$carryRight = (int) ($this->limbs[0] & ((1 << ($c + 1)) - 1));
$return->limbs[0] = (int) (($this->limbs[0] >> $c) & 0xffff);
$return->limbs[1] = (int) ((($this->limbs[1] >> $c) | ($carryRight << (16 - $c))) & 0xffff);

View File

@ -19,9 +19,18 @@ class ParagonIE_Sodium_Core32_Int64
*/
public $overflow = 0;
/**
* ParagonIE_Sodium_Core32_Int64 constructor.
* @param array $array
*/
public function __construct($array = array(0, 0, 0, 0))
{
$this->limbs = $array;
$this->limbs = array(
(int) $array[0],
(int) $array[1],
(int) $array[2],
(int) $array[3]
);
$this->overflow = 0;
}
@ -281,6 +290,7 @@ class ParagonIE_Sodium_Core32_Int64
/**
* @param int $c
* @return ParagonIE_Sodium_Core32_Int64
* @throws TypeError
*/
public function shiftLeft($c = 0)
{
@ -309,6 +319,9 @@ class ParagonIE_Sodium_Core32_Int64
} elseif ($c < 0) {
return $this->shiftRight(-$c);
} else {
if (is_null($c)) {
throw new TypeError();
}
$carry = 0;
for ($i = 3; $i >= 0; --$i) {
$tmp = ($this->limbs[$i] << $c) | ($carry & 0xffff);
@ -322,6 +335,7 @@ class ParagonIE_Sodium_Core32_Int64
/**
* @param int $c
* @return ParagonIE_Sodium_Core32_Int64
* @throws TypeError
*/
public function shiftRight($c = 0)
{
@ -361,6 +375,9 @@ class ParagonIE_Sodium_Core32_Int64
} elseif ($c < 0) {
return $this->shiftLeft(-$c);
} else {
if (is_null($c)) {
throw new TypeError();
}
$carryRight = ($negative & 0xffff);
$mask = (int) (((1 << ($c + 1)) - 1) & 0xffff);
for ($i = 0; $i < 4; ++$i) {

View File

@ -1 +1 @@
6.0.0
6.0.1

View File

@ -1,15 +1,15 @@
<?php
/**
* PHPMailer Exception class.
* PHP Version 5.5
* PHP Version 5.5.
*
* @package PHPMailer
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2016 Marcus Bointon
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@ -21,21 +21,19 @@
namespace PHPMailer\PHPMailer;
/**
* PHPMailer exception handler
* PHPMailer exception handler.
*
* @package PHPMailer
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class Exception extends \Exception
{
/**
* Prettify error message output
* Prettify error message output.
*
* @return string
*/
public function errorMessage()
{
$errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
return $errorMsg;
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
}
}

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5
* PHP Version 5.5.
*
* @package PHPMailer
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
@ -22,15 +21,15 @@
namespace PHPMailer\PHPMailer;
use League\OAuth2\Client\Grant\RefreshToken;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
/**
* OAuth - OAuth2 authentication wrapper class.
* Uses the oauth2-client package from the League of Extraordinary Packages
* Uses the oauth2-client package from the League of Extraordinary Packages.
*
* @see http://oauth2-client.thephpleague.com
* @package PHPMailer
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
class OAuth
@ -82,7 +81,7 @@ class OAuth
* OAuth constructor.
*
* @param array $options Associative array containing
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
*/
public function __construct($options)
{
@ -100,7 +99,7 @@ class OAuth
*/
protected function getGrant()
{
return new RefreshToken;
return new RefreshToken();
}
/**
@ -124,9 +123,10 @@ class OAuth
public function getOauth64()
{
// Get a new token if it's not available or has expired
if (is_null($this->oauthToken) or $this->oauthToken->hasExpired()) {
if (null === $this->oauthToken or $this->oauthToken->hasExpired()) {
$this->oauthToken = $this->getToken();
}
return base64_encode(
'user=' .
$this->oauthUserEmail .

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,15 @@
<?php
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5.5
* PHP Version 5.5.
*
* @package PHPMailer
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2016 Marcus Bointon
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@ -33,7 +33,6 @@ namespace PHPMailer\PHPMailer;
* enough to do authentication.
* If you want a more complete class there are other POP3 classes for PHP available.
*
* @package PHPMailer
* @author Richard Davey (original author) <rich@corephp.co.uk>
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
@ -46,27 +45,27 @@ class POP3
*
* @var string
*/
const VERSION = '6.0.0';
const VERSION = '6.0.1';
/**
* Default POP3 port number.
*
* @var integer
* @var int
*/
const DEFAULT_PORT = 110;
/**
* Default timeout in seconds.
*
* @var integer
* @var int
*/
const DEFAULT_TIMEOUT = 30;
/**
* Debug display level.
* Options: 0 = no, 1+ = yes
* Options: 0 = no, 1+ = yes.
*
* @var integer
* @var int
*/
public $do_debug = 0;
@ -80,19 +79,19 @@ class POP3
/**
* POP3 port number.
*
* @var integer
* @var int
*/
public $port;
/**
* POP3 Timeout Value in seconds.
*
* @var integer
* @var int
*/
public $tval;
/**
* POP3 username
* POP3 username.
*
* @var string
*/
@ -115,7 +114,7 @@ class POP3
/**
* Are we connected?
*
* @var boolean
* @var bool
*/
protected $connected = false;
@ -127,21 +126,21 @@ class POP3
protected $errors = [];
/**
* Line break constant
* Line break constant.
*/
const LE = "\r\n";
/**
* Simple static wrapper for all-in-one POP before SMTP
* Simple static wrapper for all-in-one POP before SMTP.
*
* @param string $host
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return boolean
* @return bool
*/
public static function popBeforeSmtp(
$host,
@ -151,7 +150,8 @@ class POP3
$password = '',
$debug_level = 0
) {
$pop = new POP3;
$pop = new self();
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
}
@ -160,14 +160,14 @@ class POP3
* A connect, login, disconnect sequence
* appropriate for POP-before SMTP authorisation.
*
* @param string $host The hostname to connect to
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return boolean
* @return bool
*/
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
{
@ -176,13 +176,13 @@ class POP3
if (false === $port) {
$this->port = static::DEFAULT_PORT;
} else {
$this->port = (integer)$port;
$this->port = (int) $port;
}
// If no timeout value provided, use default
if (false === $timeout) {
$this->tval = static::DEFAULT_TIMEOUT;
} else {
$this->tval = (integer)$timeout;
$this->tval = (int) $timeout;
}
$this->do_debug = $debug_level;
$this->username = $username;
@ -195,22 +195,24 @@ class POP3
$login_result = $this->login($this->username, $this->password);
if ($login_result) {
$this->disconnect();
return true;
}
}
// We need to disconnect regardless of whether the login succeeded
$this->disconnect();
return false;
}
/**
* Connect to a POP3 server.
*
* @param string $host
* @param integer|boolean $port
* @param integer $tval
* @param string $host
* @param int|bool $port
* @param int $tval
*
* @return boolean
* @return bool
*/
public function connect($host, $port = false, $tval = 30)
{
@ -242,12 +244,9 @@ class POP3
if (false === $this->pop_conn) {
// It would appear not...
$this->setError(
[
'error' => "Failed to connect to server $host on port $port",
'errno' => $errno,
'errstr' => $errstr
]
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
);
return false;
}
@ -260,8 +259,10 @@ class POP3
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
return false;
}
@ -272,7 +273,7 @@ class POP3
* @param string $username
* @param string $password
*
* @return boolean
* @return bool
*/
public function login($username = '', $password = '')
{
@ -297,6 +298,7 @@ class POP3
return true;
}
}
return false;
}
@ -312,14 +314,13 @@ class POP3
@fclose($this->pop_conn);
} catch (Exception $e) {
//Do nothing
};
}
}
/**
* Get a response from the POP3 server.
* $size is the maximum number of bytes to retrieve
*
* @param integer $size
* @param int $size The maximum number of bytes to retrieve
*
* @return string
*/
@ -327,8 +328,9 @@ class POP3
{
$response = fgets($this->pop_conn, $size);
if ($this->do_debug >= 1) {
echo "Server -> Client: $response";
echo 'Server -> Client: ', $response;
}
return $response;
}
@ -337,16 +339,18 @@ class POP3
*
* @param string $string
*
* @return integer
* @return int
*/
protected function sendString($string)
{
if ($this->pop_conn) {
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
echo "Client -> Server: $string";
echo 'Client -> Server: ', $string;
}
return fwrite($this->pop_conn, $string, strlen($string));
}
return 0;
}
@ -356,22 +360,17 @@ class POP3
*
* @param string $string
*
* @return boolean
* @return bool
*/
protected function checkResponse($string)
{
if (substr($string, 0, 3) !== '+OK') {
$this->setError(
[
'error' => "Server reported an error: $string",
'errno' => 0,
'errstr' => ''
]
);
$this->setError("Server reported an error: $string");
return false;
} else {
return true;
}
return true;
}
/**
@ -405,21 +404,16 @@ class POP3
/**
* POP3 connection error handler.
*
* @param integer $errno
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param integer $errline
* @param int $errline
*/
protected function catchWarning($errno, $errstr, $errfile, $errline)
{
$this->setError(
[
'error' => 'Connecting to the POP3 server raised a PHP warning: ',
'errno' => $errno,
'errstr' => $errstr,
'errfile' => $errfile,
'errline' => $errline
]
'Connecting to the POP3 server raised a PHP warning:' .
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,7 @@ class LintCommand extends Command
->setDescription('Lints a file and outputs encountered errors')
->addArgument('filename', null, 'A file or a directory or STDIN')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
->addOption('parse-tags', null, InputOption::VALUE_NONE, 'Parse custom tags')
->setHelp(<<<EOF
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
the first encountered syntax error.
@ -80,13 +81,14 @@ EOF
$filename = $input->getArgument('filename');
$this->format = $input->getOption('format');
$this->displayCorrectFiles = $output->isVerbose();
$flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0;
if (!$filename) {
if (!$stdin = $this->getStdin()) {
throw new \RuntimeException('Please provide a filename or pipe file content to STDIN.');
}
return $this->display($io, array($this->validate($stdin)));
return $this->display($io, array($this->validate($stdin, $flags)));
}
if (!$this->isReadable($filename)) {
@ -95,13 +97,13 @@ EOF
$filesInfo = array();
foreach ($this->getFiles($filename) as $file) {
$filesInfo[] = $this->validate(file_get_contents($file), $file);
$filesInfo[] = $this->validate(file_get_contents($file), $flags, $file);
}
return $this->display($io, $filesInfo);
}
private function validate($content, $file = null)
private function validate($content, $flags, $file = null)
{
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
if (E_USER_DEPRECATED === $level) {
@ -112,7 +114,7 @@ EOF
});
try {
$this->getParser()->parse($content, Yaml::PARSE_CONSTANT);
$this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags);
} catch (ParseException $e) {
return array('file' => $file, 'valid' => false, 'message' => $e->getMessage());
} finally {
@ -149,7 +151,7 @@ EOF
}
}
if ($erroredFiles === 0) {
if (0 === $erroredFiles) {
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
} else {
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles));

View File

@ -24,8 +24,6 @@ class ParseException extends RuntimeException
private $rawMessage;
/**
* Constructor.
*
* @param string $message The error message
* @param int $parsedLine The line where the error occurred
* @param string|null $snippet The snippet of code near the problem

View File

@ -335,7 +335,7 @@ class Inline
}
if ($output && '%' === $output[0]) {
@trigger_error(sprintf('Not quoting the scalar "%s" starting with the "%%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', $output), E_USER_DEPRECATED);
@trigger_error(sprintf('Not quoting the scalar "%s" starting with the "%%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0 on line %d.', $output, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
if ($evaluate) {
@ -487,19 +487,19 @@ class Inline
}
if (':' === $key) {
@trigger_error('Omitting the key of a mapping is deprecated and will throw a ParseException in 4.0.', E_USER_DEPRECATED);
@trigger_error(sprintf('Omitting the key of a mapping is deprecated and will throw a ParseException in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags)) {
$evaluatedKey = self::evaluateScalar($key, $flags, $references);
if ('' !== $key && $evaluatedKey !== $key && !is_string($evaluatedKey) && !is_int($evaluatedKey)) {
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead.', E_USER_DEPRECATED);
@trigger_error(sprintf('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
}
if (':' !== $key && !$isKeyQuoted && (!isset($mapping[$i + 1]) || !in_array($mapping[$i + 1], array(' ', ',', '[', ']', '{', '}'), true))) {
@trigger_error('Using a colon after an unquoted mapping key that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}") is deprecated since version 3.2 and will throw a ParseException in 4.0.', E_USER_DEPRECATED);
@trigger_error(sprintf('Using a colon after an unquoted mapping key that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}") is deprecated since version 3.2 and will throw a ParseException in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
while ($i < $len) {
@ -519,7 +519,7 @@ class Inline
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
if (isset($output[$key])) {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
$duplicate = true;
}
break;
@ -530,7 +530,7 @@ class Inline
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
if (isset($output[$key])) {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
$duplicate = true;
}
break;
@ -540,7 +540,7 @@ class Inline
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
if (isset($output[$key])) {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
$duplicate = true;
}
--$i;
@ -606,7 +606,7 @@ class Inline
return true;
case 'false' === $scalarLower:
return false;
case $scalar[0] === '!':
case '!' === $scalar[0]:
switch (true) {
case 0 === strpos($scalar, '!str'):
return (string) substr($scalar, 5);
@ -624,7 +624,7 @@ class Inline
return;
case 0 === strpos($scalar, '!!php/object:'):
if (self::$objectSupport) {
@trigger_error('The !!php/object tag to indicate dumped PHP objects is deprecated since version 3.1 and will be removed in 4.0. Use the !php/object tag instead.', E_USER_DEPRECATED);
@trigger_error(sprintf('The !!php/object tag to indicate dumped PHP objects is deprecated since version 3.1 and will be removed in 4.0. Use the !php/object tag instead on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
return unserialize(substr($scalar, 13));
}
@ -652,15 +652,17 @@ class Inline
case 0 === strpos($scalar, '!!binary '):
return self::evaluateBinaryScalar(substr($scalar, 9));
default:
@trigger_error(sprintf('Using the unquoted scalar value "%s" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it.', $scalar), E_USER_DEPRECATED);
@trigger_error(sprintf('Using the unquoted scalar value "%s" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it on line %d.', $scalar, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
// Optimize for returning strings.
case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || is_numeric($scalar[0]):
// no break
case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || is_numeric($scalar[0]):
switch (true) {
case Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar):
$scalar = str_replace('_', '', (string) $scalar);
// omitting the break / return as integers are handled in the next case
// no break
case ctype_digit($scalar):
$raw = $scalar;
$cast = (int) $scalar;
@ -684,7 +686,7 @@ class Inline
case Parser::preg_match('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar):
case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
if (false !== strpos($scalar, ',')) {
@trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
@trigger_error(sprintf('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}
return (float) str_replace(array(',', '_'), '', $scalar);

View File

@ -178,7 +178,7 @@ class Parser
}
if (isset($values['value'][1]) && '?' === $values['value'][0] && ' ' === $values['value'][1]) {
@trigger_error('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', E_USER_DEPRECATED);
@trigger_error(sprintf('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
// array
@ -238,7 +238,7 @@ class Parser
if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags) && !is_string($key) && !is_int($key)) {
$keyType = is_numeric($key) ? 'numeric key' : 'non-string key';
@trigger_error(sprintf('Implicit casting of %s to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead.', $keyType), E_USER_DEPRECATED);
@trigger_error(sprintf('Implicit casting of %s to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line %d.', $keyType, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
// Convert float keys to strings, to avoid being converted to integers by PHP
@ -246,10 +246,10 @@ class Parser
$key = (string) $key;
}
if ('<<' === $key) {
if ('<<' === $key && (!isset($values['value']) || !self::preg_match('#^&(?P<ref>[^ ]+)#u', $values['value'], $refMatches))) {
$mergeNode = true;
$allowOverwrite = true;
if (isset($values['value']) && 0 === strpos($values['value'], '*')) {
if (isset($values['value'][0]) && '*' === $values['value'][0]) {
$refName = substr(rtrim($values['value']), 1);
if (!array_key_exists($refName, $this->refs)) {
throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine);
@ -257,19 +257,27 @@ class Parser
$refValue = $this->refs[$refName];
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $refValue instanceof \stdClass) {
$refValue = (array) $refValue;
}
if (!is_array($refValue)) {
throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
}
$data += $refValue; // array union
} else {
if (isset($values['value']) && $values['value'] !== '') {
if (isset($values['value']) && '' !== $values['value']) {
$value = $values['value'];
} else {
$value = $this->getNextEmbedBlock();
}
$parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags);
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsed instanceof \stdClass) {
$parsed = (array) $parsed;
}
if (!is_array($parsed)) {
throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
}
@ -279,6 +287,10 @@ class Parser
// and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier
// in the sequence override keys specified in later mapping nodes.
foreach ($parsed as $parsedItem) {
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsedItem instanceof \stdClass) {
$parsedItem = (array) $parsedItem;
}
if (!is_array($parsedItem)) {
throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem);
}
@ -291,7 +303,7 @@ class Parser
$data += $parsed; // array union
}
}
} elseif (isset($values['value']) && self::preg_match('#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u', $values['value'], $matches)) {
} elseif ('<<' !== $key && isset($values['value']) && self::preg_match('#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u', $values['value'], $matches)) {
$isRef = $matches['ref'];
$values['value'] = $matches['value'];
}
@ -299,7 +311,7 @@ class Parser
$subTag = null;
if ($mergeNode) {
// Merge keys
} elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags))) {
} elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) {
// hash
// if next line is less indented or equal, then it means that the current value is null
if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) {
@ -312,22 +324,30 @@ class Parser
$data[$key] = null;
}
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
} else {
// remember the parsed line number here in case we need it to provide some contexts in error messages below
$realCurrentLineNbKey = $this->getRealCurrentLineNb();
$value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
// Spec: Keys MUST be unique; first one wins.
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
if ('<<' === $key) {
$this->refs[$refMatches['ref']] = $value;
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) {
$value = (array) $value;
}
$data += $value;
} elseif ($allowOverwrite || !isset($data[$key])) {
// Spec: Keys MUST be unique; first one wins.
// But overwriting is allowed when a merge node is used in current block.
if (null !== $subTag) {
$data[$key] = new TaggedValue($subTag, $value);
} else {
$data[$key] = $value;
}
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $realCurrentLineNbKey + 1), E_USER_DEPRECATED);
}
}
} else {
@ -337,7 +357,7 @@ class Parser
if ($allowOverwrite || !isset($data[$key])) {
$data[$key] = $value;
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
}
if ($isRef) {
@ -350,7 +370,7 @@ class Parser
}
if (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1]) {
@trigger_error('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', E_USER_DEPRECATED);
@trigger_error(sprintf('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
// 1-liner optionally followed by newline(s)
@ -372,6 +392,7 @@ class Parser
if (0 === $this->currentLineNb) {
$parseError = false;
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = false;
$value = '';
foreach ($this->lines as $line) {
@ -389,13 +410,25 @@ class Parser
if ('' === trim($parsedLine)) {
$value .= "\n";
$previousLineWasNewline = true;
} elseif ($previousLineWasNewline) {
} elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) {
$value .= ' ';
}
if ('' !== trim($parsedLine) && '\\' === substr($parsedLine, -1)) {
$value .= ltrim(substr($parsedLine, 0, -1));
} elseif ('' !== trim($parsedLine)) {
$value .= trim($parsedLine);
}
if ('' === trim($parsedLine)) {
$previousLineWasNewline = true;
$previousLineWasTerminatedWithBackslash = false;
} elseif ('\\' === substr($parsedLine, -1)) {
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = true;
} else {
$value .= ' '.trim($parsedLine);
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = false;
}
} catch (ParseException $e) {
$parseError = true;
@ -404,7 +437,7 @@ class Parser
}
if (!$parseError) {
return trim($value);
return Inline::parse(trim($value));
}
}
@ -544,7 +577,7 @@ class Parser
$indent = $this->getCurrentLineIndentation();
// terminate all block scalars that are more indented than the current line
if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && trim($this->currentLine) !== '') {
if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && '' !== trim($this->currentLine)) {
foreach ($blockScalarIndentations as $key => $blockScalarIndentation) {
if ($blockScalarIndentation >= $indent) {
unset($blockScalarIndentations[$key]);
@ -663,7 +696,7 @@ class Parser
if ('!!binary' === $matches['tag']) {
return Inline::evaluateBinaryScalar($data);
} elseif ('!' !== $matches['tag']) {
@trigger_error(sprintf('Using the custom tag "%s" for the value "%s" is deprecated since version 3.3. It will be replaced by an instance of %s in 4.0.', $matches['tag'], $data, TaggedValue::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Using the custom tag "%s" for the value "%s" is deprecated since version 3.3. It will be replaced by an instance of %s in 4.0 on line %d.', $matches['tag'], $data, TaggedValue::class, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
}
}
@ -680,7 +713,7 @@ class Parser
while ($this->moveToNextLine()) {
// unquoted strings end before the first unindented line
if (null === $quotation && $this->getCurrentLineIndentation() === 0) {
if (null === $quotation && 0 === $this->getCurrentLineIndentation()) {
$this->moveToPreviousLine();
break;
@ -876,7 +909,7 @@ class Parser
//checking explicitly the first char of the trim is faster than loops or strpos
$ltrimmedLine = ltrim($this->currentLine, ' ');
return '' !== $ltrimmedLine && $ltrimmedLine[0] === '#';
return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0];
}
private function isCurrentLineLastLineInDocument()
@ -902,7 +935,7 @@ class Parser
// remove leading comments
$trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count);
if ($count == 1) {
if (1 === $count) {
// items have been removed, update the offset
$this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
$value = $trimmedValue;
@ -910,7 +943,7 @@ class Parser
// remove start of the document marker (---)
$trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count);
if ($count == 1) {
if (1 === $count) {
// items have been removed, update the offset
$this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
$value = $trimmedValue;

View File

@ -1,9 +1,7 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/

View File

@ -1,9 +1,7 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/

View File

@ -1,9 +1,7 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
@ -59,7 +57,7 @@ class PhpInputStream extends Stream
public function read($length)
{
$content = parent::read($length);
if ($content && ! $this->reachedEof) {
if (! $this->reachedEof) {
$this->cache .= $content;
}

View File

@ -1,9 +1,7 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
@ -48,7 +46,9 @@ final class RelativeStream implements StreamInterface
*/
public function __toString()
{
$this->seek(0);
if ($this->isSeekable()) {
$this->seek(0);
}
return $this->getContents();
}

Some files were not shown because too many files have changed in this diff Show More