Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	config/index.php
#	config/service.yml
#	mollie.php
#	src/Builder/FormBuilder.php
#	src/Repository/MolCarrierInformationRepository.php
#	src/Service/CarrierService.php
#	src/Service/IssuerService.php
#	src/Service/PaymentMethodService.php
#	src/Service/ShipmentService.php
#	vendor/composer/ca-bundle/index.php
#	vendor/composer/ca-bundle/res/index.php
#	vendor/composer/ca-bundle/src/index.php
#	vendor/composer/index.php
#	vendor/guzzlehttp/guzzle/index.php
#	vendor/guzzlehttp/guzzle/src/Cookie/index.php
#	vendor/guzzlehttp/guzzle/src/Exception/index.php
#	vendor/guzzlehttp/guzzle/src/Handler/index.php
#	vendor/guzzlehttp/guzzle/src/index.php
#	vendor/guzzlehttp/index.php
#	vendor/guzzlehttp/promises/index.php
#	vendor/guzzlehttp/promises/src/index.php
#	vendor/guzzlehttp/psr7/index.php
#	vendor/guzzlehttp/psr7/src/index.php
#	vendor/index.php
#	vendor/mollie/index.php
#	vendor/mollie/mollie-api-php/examples/captures/index.php
#	vendor/mollie/mollie-api-php/examples/customers/index.php
#	vendor/mollie/mollie-api-php/examples/index.php
#	vendor/mollie/mollie-api-php/examples/invoices/index.php
#	vendor/mollie/mollie-api-php/examples/mandates/index.php
#	vendor/mollie/mollie-api-php/examples/orders/index.php
#	vendor/mollie/mollie-api-php/examples/payments/index.php
#	vendor/mollie/mollie-api-php/examples/profiles/index.php
#	vendor/mollie/mollie-api-php/examples/settlements/index.php
#	vendor/mollie/mollie-api-php/examples/shipments/index.php
#	vendor/mollie/mollie-api-php/examples/subscriptions/index.php
#	vendor/mollie/mollie-api-php/index.php
#	vendor/mollie/mollie-api-php/src/Endpoints/index.php
#	vendor/mollie/mollie-api-php/src/Exceptions/index.php
#	vendor/mollie/mollie-api-php/src/Resources/index.php
#	vendor/mollie/mollie-api-php/src/Types/index.php
#	vendor/mollie/mollie-api-php/src/index.php
#	vendor/paragonie/index.php
#	vendor/paragonie/random_compat/dist/index.php
#	vendor/paragonie/random_compat/index.php
#	vendor/paragonie/random_compat/lib/index.php
#	vendor/psr/cache/index.php
#	vendor/psr/cache/src/index.php
#	vendor/psr/container/index.php
#	vendor/psr/container/src/index.php
#	vendor/psr/http-message/index.php
#	vendor/psr/http-message/src/index.php
#	vendor/psr/index.php
#	vendor/psr/log/Psr/Log/Test/index.php
#	vendor/psr/log/Psr/Log/index.php
#	vendor/psr/log/Psr/index.php
#	vendor/psr/log/index.php
#	vendor/psr/simple-cache/index.php
#	vendor/psr/simple-cache/src/index.php
#	vendor/ralouphie/getallheaders/index.php
#	vendor/ralouphie/getallheaders/src/index.php
#	vendor/ralouphie/index.php
#	vendor/symfony/cache/Adapter/index.php
#	vendor/symfony/cache/DataCollector/index.php
#	vendor/symfony/cache/Exception/index.php
#	vendor/symfony/cache/Simple/index.php
#	vendor/symfony/cache/Tests/Adapter/index.php
#	vendor/symfony/cache/Tests/Fixtures/index.php
#	vendor/symfony/cache/Tests/Simple/index.php
#	vendor/symfony/cache/Tests/Traits/index.php
#	vendor/symfony/cache/Tests/index.php
#	vendor/symfony/cache/Traits/index.php
#	vendor/symfony/cache/index.php
#	vendor/symfony/config/Definition/Builder/index.php
#	vendor/symfony/config/Definition/Dumper/index.php
#	vendor/symfony/config/Definition/Exception/index.php
#	vendor/symfony/config/Definition/index.php
#	vendor/symfony/config/DependencyInjection/index.php
#	vendor/symfony/config/Exception/index.php
#	vendor/symfony/config/Loader/index.php
#	vendor/symfony/config/Resource/index.php
#	vendor/symfony/config/Tests/Definition/Builder/index.php
#	vendor/symfony/config/Tests/Definition/Dumper/index.php
#	vendor/symfony/config/Tests/Definition/index.php
#	vendor/symfony/config/Tests/DependencyInjection/index.php
#	vendor/symfony/config/Tests/Exception/index.php
#	vendor/symfony/config/Tests/Fixtures/Again/index.php
#	vendor/symfony/config/Tests/Fixtures/Builder/index.php
#	vendor/symfony/config/Tests/Fixtures/Configuration/index.php
#	vendor/symfony/config/Tests/Fixtures/ParseError.php
#	vendor/symfony/config/Tests/Fixtures/Resource/index.php
#	vendor/symfony/config/Tests/Fixtures/Util/index.php
#	vendor/symfony/config/Tests/Fixtures/index.php
#	vendor/symfony/config/Tests/Loader/index.php
#	vendor/symfony/config/Tests/Resource/index.php
#	vendor/symfony/config/Tests/Util/index.php
#	vendor/symfony/config/Tests/index.php
#	vendor/symfony/config/Util/Exception/index.php
#	vendor/symfony/config/Util/index.php
#	vendor/symfony/config/index.php
#	vendor/symfony/dependency-injection/Argument/index.php
#	vendor/symfony/dependency-injection/Compiler/index.php
#	vendor/symfony/dependency-injection/Config/index.php
#	vendor/symfony/dependency-injection/Dumper/index.php
#	vendor/symfony/dependency-injection/Exception/index.php
#	vendor/symfony/dependency-injection/Extension/index.php
#	vendor/symfony/dependency-injection/LazyProxy/Instantiator/index.php
#	vendor/symfony/dependency-injection/LazyProxy/PhpDumper/index.php
#	vendor/symfony/dependency-injection/LazyProxy/index.php
#	vendor/symfony/dependency-injection/Loader/Configurator/Traits/index.php
#	vendor/symfony/dependency-injection/Loader/Configurator/index.php
#	vendor/symfony/dependency-injection/Loader/index.php
#	vendor/symfony/dependency-injection/Loader/schema/dic/index.php
#	vendor/symfony/dependency-injection/Loader/schema/dic/services/index.php
#	vendor/symfony/dependency-injection/Loader/schema/index.php
#	vendor/symfony/dependency-injection/ParameterBag/index.php
#	vendor/symfony/dependency-injection/Tests/Argument/index.php
#	vendor/symfony/dependency-injection/Tests/Compiler/index.php
#	vendor/symfony/dependency-injection/Tests/Config/index.php
#	vendor/symfony/dependency-injection/Tests/Dumper/index.php
#	vendor/symfony/dependency-injection/Tests/Extension/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Container/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/BadClasses/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/AnotherSub/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component1/Dir1/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component1/Dir2/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component1/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component2/Dir1/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component2/Dir2/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/Component2/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/OtherDir/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/Sub/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/Prototype/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/config/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/containers/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/directory/import/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/directory/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/directory/recurse/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/includes/HotPath/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/includes/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/includes/schema/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/ini/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/php/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension1/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension2/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/xml/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bar/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/foo/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/autoconfigure_child_not_applied/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/autoconfigure_parent_child/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/autoconfigure_parent_child_tags/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/child_parent/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/defaults_child_tags/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/defaults_instanceof_importance/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/defaults_parent_child/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/index.php
#	vendor/symfony/dependency-injection/Tests/Fixtures/yaml/integration/instanceof_parent_child/index.php
#	vendor/symfony/dependency-injection/Tests/LazyProxy/Instantiator/index.php
#	vendor/symfony/dependency-injection/Tests/LazyProxy/PhpDumper/index.php
#	vendor/symfony/dependency-injection/Tests/LazyProxy/index.php
#	vendor/symfony/dependency-injection/Tests/Loader/index.php
#	vendor/symfony/dependency-injection/Tests/ParameterBag/index.php
#	vendor/symfony/dependency-injection/Tests/index.php
#	vendor/symfony/dependency-injection/index.php
#	vendor/symfony/expression-language/Node/index.php
#	vendor/symfony/expression-language/ParserCache/index.php
#	vendor/symfony/expression-language/Resources/bin/index.php
#	vendor/symfony/expression-language/Resources/index.php
#	vendor/symfony/expression-language/Tests/Fixtures/index.php
#	vendor/symfony/expression-language/Tests/Node/index.php
#	vendor/symfony/expression-language/Tests/ParserCache/index.php
#	vendor/symfony/expression-language/Tests/index.php
#	vendor/symfony/expression-language/index.php
#	vendor/symfony/filesystem/Exception/index.php
#	vendor/symfony/filesystem/Tests/Fixtures/MockStream/index.php
#	vendor/symfony/filesystem/Tests/Fixtures/index.php
#	vendor/symfony/filesystem/Tests/index.php
#	vendor/symfony/filesystem/index.php
#	vendor/symfony/index.php
#	vendor/symfony/polyfill-apcu/index.php
#	vendor/symfony/polyfill-ctype/index.php
#	vendor/symfony/polyfill-intl-idn/index.php
#	vendor/symfony/polyfill-mbstring/Resources/index.php
#	vendor/symfony/polyfill-mbstring/Resources/unidata/index.php
#	vendor/symfony/polyfill-mbstring/index.php
#	vendor/symfony/polyfill-php70/Resources/index.php
#	vendor/symfony/polyfill-php70/Resources/stubs/index.php
#	vendor/symfony/polyfill-php70/index.php
#	vendor/symfony/polyfill-php72/index.php
#	vendor/symfony/yaml/Command/index.php
#	vendor/symfony/yaml/Exception/index.php
#	vendor/symfony/yaml/Tag/index.php
#	vendor/symfony/yaml/Tests/Command/index.php
#	vendor/symfony/yaml/Tests/Fixtures/index.php
#	vendor/symfony/yaml/Tests/index.php
#	vendor/symfony/yaml/index.php
#	views/js/admin/index.php
#	views/js/dist/index.php
#	views/templates/admin/_configure/helpers/form/form.tpl
#	views/templates/front/order-confirmation-table.tpl
#	views/templates/hook/payment.tpl
  • Loading branch information
margud committed May 20, 2020
2 parents 37b84e6 + 9631cd7 commit 2aae53d
Show file tree
Hide file tree
Showing 858 changed files with 18,193 additions and 13,537 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>mollie</name>
<displayName><![CDATA[Mollie]]></displayName>
<version><![CDATA[4.0.0]]></version>
<version><![CDATA[4.0.1]]></version>
<description><![CDATA[Mollie Payments]]></description>
<author><![CDATA[Mollie B.V.]]></author>
<tab><![CDATA[payments_gateways]]></tab>
Expand Down
10 changes: 6 additions & 4 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace Composer\Autoload;

use InvalidArgumentException;

/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
Expand Down Expand Up @@ -151,7 +153,7 @@ public function add($prefix, $paths, $prepend = false)
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
Expand All @@ -172,7 +174,7 @@ public function addPsr4($prefix, $paths, $prepend = false)
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
throw new InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
Expand Down Expand Up @@ -214,7 +216,7 @@ public function set($prefix, $paths)
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
Expand All @@ -223,7 +225,7 @@ public function setPsr4($prefix, $paths)
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
throw new InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
Expand Down
7 changes: 5 additions & 2 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// autoload_real.php @generated by Composer

use Composer\Autoload\ClassLoader;
use Composer\Autoload\ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf;

class ComposerAutoloaderInitc2b58ae5c6462b5d003510a1194fafcf
{
private static $loader;
Expand All @@ -20,14 +23,14 @@ public static function getLoader()
}

spl_autoload_register(array('ComposerAutoloaderInitc2b58ae5c6462b5d003510a1194fafcf', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
self::$loader = $loader = new ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitc2b58ae5c6462b5d003510a1194fafcf', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf::getInitializer($loader));
call_user_func(ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand Down
4 changes: 3 additions & 1 deletion vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Composer\Autoload;

use Closure;

class ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf
{
public static $files = array (
Expand Down Expand Up @@ -716,7 +718,7 @@ class ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf

public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
return Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc2b58ae5c6462b5d003510a1194fafcf::$classMap;
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/ca-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Basic usage
#### To use with curl

```php
$curl = curl_init("https://example.org/");
use Composer\CaBundle\CaBundle;$curl = curl_init("https://example.org/");

$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
$caPathOrFile = CaBundle::getSystemCaRootBundlePath();
if (is_dir($caPathOrFile)) {
curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile);
} else {
Expand All @@ -60,7 +60,7 @@ $opts = array(
)
);

$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
$caPathOrFile = CaBundle::getSystemCaRootBundlePath();
if (is_dir($caPathOrFile)) {
$opts['ssl']['capath'] = $caPathOrFile;
} else {
Expand All @@ -74,8 +74,8 @@ $result = file_get_contents('https://example.com', false, $context);
#### To use with Guzzle

```php
$client = new \GuzzleHttp\Client([
\GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath()
use Composer\CaBundle\CaBundle;use GuzzleHttp\Client;use GuzzleHttp\RequestOptions;$client = new Client([
RequestOptions::VERIFY => CaBundle::getSystemCaRootBundlePath()
]);
```

Expand Down
118 changes: 75 additions & 43 deletions vendor/composer/ca-bundle/src/CaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@

use _PhpScoper5ea00cc67502b\Psr\Log\LoggerInterface;
use _PhpScoper5ea00cc67502b\Symfony\Component\Process\PhpProcess;
use Exception;
use function array_merge;
use function class_exists;
use function count;
use function defined;
use function dirname;
use function file_get_contents;
use function file_put_contents;
use function getenv;
use function glob;
use function ini_get;
use function is_dir;
use function is_file;
use function is_readable;
use function openssl_x509_parse;
use function preg_match;
use function preg_quote;
use function preg_replace;
use function preg_split;
use function realpath;
use function register_shutdown_function;
use function sprintf;
use function strlen;
use function strpos;
use function sys_get_temp_dir;
use function tempnam;
use function trim;
use function unlink;
use const PHP_SAPI;
use const PHP_VERSION;
use const PHP_VERSION_ID;

/**
* @author Chris Smith <[email protected]>
* @author Jordi Boggiano <[email protected]>
Expand Down Expand Up @@ -58,7 +90,7 @@ class CaBundle
* @param LoggerInterface $logger optional logger for information about which CA files were loaded
* @return string path to a CA bundle file or directory
*/
public static function getSystemCaRootBundlePath(\_PhpScoper5ea00cc67502b\Psr\Log\LoggerInterface $logger = null)
public static function getSystemCaRootBundlePath(LoggerInterface $logger = null)
{
if (self::$caPath !== null) {
return self::$caPath;
Expand All @@ -70,8 +102,8 @@ public static function getSystemCaRootBundlePath(\_PhpScoper5ea00cc67502b\Psr\Lo
// If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that.
// This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
$caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR');
$caBundlePaths[] = \ini_get('openssl.cafile');
$caBundlePaths[] = \ini_get('openssl.capath');
$caBundlePaths[] = ini_get('openssl.cafile');
$caBundlePaths[] = ini_get('openssl.capath');
$otherLocations = array(
'/etc/pki/tls/certs/ca-bundle.crt',
// Fedora, RHEL, CentOS (ca-certificates package)
Expand All @@ -98,9 +130,9 @@ public static function getSystemCaRootBundlePath(\_PhpScoper5ea00cc67502b\Psr\Lo
'/usr/local/etc/[email protected]/cert.pem',
);
foreach ($otherLocations as $location) {
$otherLocations[] = \dirname($location);
$otherLocations[] = dirname($location);
}
$caBundlePaths = \array_merge($caBundlePaths, $otherLocations);
$caBundlePaths = array_merge($caBundlePaths, $otherLocations);
foreach ($caBundlePaths as $caBundle) {
if (self::caFileUsable($caBundle, $logger)) {
return self::$caPath = $caBundle;
Expand All @@ -124,10 +156,10 @@ public static function getBundledCaBundlePath()
$caBundleFile = __DIR__ . '/../res/cacert.pem';
// cURL does not understand 'phar://' paths
// see https://github.com/composer/ca-bundle/issues/10
if (0 === \strpos($caBundleFile, 'phar://')) {
\file_put_contents($tempCaBundleFile = \tempnam(\sys_get_temp_dir(), 'openssl-ca-bundle-'), \file_get_contents($caBundleFile));
\register_shutdown_function(function () use($tempCaBundleFile) {
@\unlink($tempCaBundleFile);
if (0 === strpos($caBundleFile, 'phar://')) {
file_put_contents($tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'), file_get_contents($caBundleFile));
register_shutdown_function(function () use($tempCaBundleFile) {
@unlink($tempCaBundleFile);
});
$caBundleFile = $tempCaBundleFile;
}
Expand All @@ -141,27 +173,27 @@ public static function getBundledCaBundlePath()
*
* @return bool
*/
public static function validateCaFile($filename, \_PhpScoper5ea00cc67502b\Psr\Log\LoggerInterface $logger = null)
public static function validateCaFile($filename, LoggerInterface $logger = null)
{
static $warned = \false;
static $warned = false;
if (isset(self::$caFileValidity[$filename])) {
return self::$caFileValidity[$filename];
}
$contents = \file_get_contents($filename);
$contents = file_get_contents($filename);
// assume the CA is valid if php is vulnerable to
// https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html
if (!static::isOpensslParseSafe()) {
if (!$warned && $logger) {
$logger->warning(\sprintf('Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', \PHP_VERSION));
$warned = \true;
$logger->warning(sprintf('Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', PHP_VERSION));
$warned = true;
}
$isValid = !empty($contents);
} else {
$contents = \preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents);
$isValid = (bool) \openssl_x509_parse($contents);
$contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents);
$isValid = (bool) openssl_x509_parse($contents);
}
if ($logger) {
$logger->debug('Checked CA file ' . \realpath($filename) . ': ' . ($isValid ? 'valid' : 'invalid'));
$logger->debug('Checked CA file ' . realpath($filename) . ': ' . ($isValid ? 'valid' : 'invalid'));
}
return self::$caFileValidity[$filename] = $isValid;
}
Expand All @@ -178,35 +210,35 @@ public static function isOpensslParseSafe()
if (null !== self::$useOpensslParse) {
return self::$useOpensslParse;
}
if (\PHP_VERSION_ID >= 50600) {
return self::$useOpensslParse = \true;
if (PHP_VERSION_ID >= 50600) {
return self::$useOpensslParse = true;
}
// Vulnerable:
// PHP 5.3.0 - PHP 5.3.27
// PHP 5.4.0 - PHP 5.4.22
// PHP 5.5.0 - PHP 5.5.6
if (\PHP_VERSION_ID < 50400 && \PHP_VERSION_ID >= 50328 || \PHP_VERSION_ID < 50500 && \PHP_VERSION_ID >= 50423 || \PHP_VERSION_ID < 50600 && \PHP_VERSION_ID >= 50507) {
if (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328 || PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423 || PHP_VERSION_ID < 50600 && PHP_VERSION_ID >= 50507) {
// This version of PHP has the fix for CVE-2013-6420 applied.
return self::$useOpensslParse = \true;
return self::$useOpensslParse = true;
}
if (\defined('PHP_WINDOWS_VERSION_BUILD')) {
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
// Windows is probably insecure in this case.
return self::$useOpensslParse = \false;
return self::$useOpensslParse = false;
}
$compareDistroVersionPrefix = function ($prefix, $fixedVersion) {
$regex = '{^' . \preg_quote($prefix) . '([0-9]+)$}';
if (\preg_match($regex, \PHP_VERSION, $m)) {
$regex = '{^' . preg_quote($prefix) . '([0-9]+)$}';
if (preg_match($regex, PHP_VERSION, $m)) {
return (int) $m[1] >= $fixedVersion;
}
return \false;
return false;
};
// Hard coded list of PHP distributions with the fix backported.
if ($compareDistroVersionPrefix('5.3.3-7+squeeze', 18) || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9)) {
return self::$useOpensslParse = \true;
return self::$useOpensslParse = true;
}
// Symfony Process component is missing so we assume it is unsafe at this point
if (!\class_exists('_PhpScoper5ea00cc67502b\\Symfony\\Component\\Process\\PhpProcess')) {
return self::$useOpensslParse = \false;
if (!class_exists('_PhpScoper5ea00cc67502b\\Symfony\\Component\\Process\\PhpProcess')) {
return self::$useOpensslParse = false;
}
// This is where things get crazy, because distros backport security
// fixes the chances are on NIX systems the fix has been applied but
Expand All @@ -224,22 +256,22 @@ public static function isOpensslParseSafe()
var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']);

EOT;
$script = '<' . "?php\n" . \sprintf($script, $cert);
$script = '<' . "?php\n" . sprintf($script, $cert);
try {
$process = new \_PhpScoper5ea00cc67502b\Symfony\Component\Process\PhpProcess($script);
$process = new PhpProcess($script);
$process->mustRun();
} catch (\Exception $e) {
} catch (Exception $e) {
// In the case of any exceptions just accept it is not possible to
// determine the safety of openssl_x509_parse and bail out.
return self::$useOpensslParse = \false;
return self::$useOpensslParse = false;
}
$output = \preg_split('{\\r?\\n}', \trim($process->getOutput()));
$errorOutput = \trim($process->getErrorOutput());
if (\count($output) === 3 && $output[0] === \sprintf('string(%d) "%s"', \strlen(\PHP_VERSION), \PHP_VERSION) && $output[1] === 'string(27) "[email protected]"' && $output[2] === 'int(-1)' && \preg_match('{openssl_x509_parse\\(\\): illegal (?:ASN1 data type for|length in) timestamp in - on line \\d+}', $errorOutput)) {
$output = preg_split('{\\r?\\n}', trim($process->getOutput()));
$errorOutput = trim($process->getErrorOutput());
if (count($output) === 3 && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION) && $output[1] === 'string(27) "[email protected]"' && $output[2] === 'int(-1)' && preg_match('{openssl_x509_parse\\(\\): illegal (?:ASN1 data type for|length in) timestamp in - on line \\d+}', $errorOutput)) {
// This PHP has the fix backported probably by a distro security team.
return self::$useOpensslParse = \true;
return self::$useOpensslParse = true;
}
return self::$useOpensslParse = \false;
return self::$useOpensslParse = false;
}
/**
* Resets the static caches
Expand All @@ -255,17 +287,17 @@ private static function getEnvVariable($name)
if (isset($_SERVER[$name])) {
return (string) $_SERVER[$name];
}
if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== \false && $value !== null) {
if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) {
return (string) $value;
}
return \false;
return false;
}
private static function caFileUsable($certFile, \_PhpScoper5ea00cc67502b\Psr\Log\LoggerInterface $logger = null)
private static function caFileUsable($certFile, LoggerInterface $logger = null)
{
return $certFile && @\is_file($certFile) && @\is_readable($certFile) && static::validateCaFile($certFile, $logger);
return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger);
}
private static function caDirUsable($certDir)
{
return $certDir && @\is_dir($certDir) && @\is_readable($certDir) && \glob($certDir . '/*');
return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*');
}
}
4 changes: 2 additions & 2 deletions vendor/guzzlehttp/guzzle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ trivial to integrate with web services.
- Middleware system allows you to augment and compose client behavior.

```php
$client = new \GuzzleHttp\Client();
use GuzzleHttp\Client;use GuzzleHttp\Psr7\Request;$client = new Client();
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');

echo $response->getStatusCode(); # 200
echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'
echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}'

# Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$request = new Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response->getBody();
});
Expand Down
Loading

0 comments on commit 2aae53d

Please sign in to comment.