summaryrefslogtreecommitdiff
path: root/vendor/symfony
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-13 15:26:23 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-13 15:26:23 +0000
commit6ddab597f679060f73c189b092529f59d59f8eb0 (patch)
tree2d6d01d08d1f39e76ac2938e3ed7ced9aea2fc7c /vendor/symfony
parentcf6ece77e5c310b96aff1de5a9d01d8c5ddda5c2 (diff)
downloadwebtrees-6ddab597f679060f73c189b092529f59d59f8eb0.tar.gz
webtrees-6ddab597f679060f73c189b092529f59d59f8eb0.tar.bz2
webtrees-6ddab597f679060f73c189b092529f59d59f8eb0.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony')
-rw-r--r--vendor/symfony/cache/Adapter/TagAwareAdapter.php10
-rw-r--r--vendor/symfony/cache/Traits/AbstractAdapterTrait.php10
-rw-r--r--vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherProxyTest.php (renamed from vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php)2
-rw-r--r--vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/File/Fixtures/-testbin0 -> 35 bytes
-rw-r--r--vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php11
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php6
-rw-r--r--vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php8
-rw-r--r--vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php4
-rw-r--r--vendor/symfony/http-kernel/Kernel.php6
-rw-r--r--vendor/symfony/http-kernel/Profiler/Profiler.php6
-rw-r--r--vendor/symfony/http-kernel/UriSigner.php2
-rw-r--r--vendor/symfony/mime/FileBinaryMimeTypeGuesser.php4
-rw-r--r--vendor/symfony/mime/Tests/AbstractMimeTypeGuesserTest.php15
-rw-r--r--vendor/symfony/mime/Tests/Fixtures/mimetypes/-testbin0 -> 35 bytes
-rw-r--r--vendor/symfony/translation/Tests/TranslatorCacheTest.php16
-rw-r--r--vendor/symfony/translation/Translator.php9
-rw-r--r--vendor/symfony/var-exporter/Internal/Exporter.php35
-rw-r--r--vendor/symfony/var-exporter/Tests/Fixtures/lf-ending-string.php4
-rw-r--r--vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php3
-rw-r--r--vendor/symfony/var-exporter/Tests/VarExporterTest.php1
21 files changed, 116 insertions, 40 deletions
diff --git a/vendor/symfony/cache/Adapter/TagAwareAdapter.php b/vendor/symfony/cache/Adapter/TagAwareAdapter.php
index 8bcf57e82c..72fc526ad7 100644
--- a/vendor/symfony/cache/Adapter/TagAwareAdapter.php
+++ b/vendor/symfony/cache/Adapter/TagAwareAdapter.php
@@ -286,6 +286,16 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
return $this->invalidateTags([]);
}
+ public function __sleep()
+ {
+ throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ }
+
+ public function __wakeup()
+ {
+ throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ }
+
public function __destruct()
{
$this->commit();
diff --git a/vendor/symfony/cache/Traits/AbstractAdapterTrait.php b/vendor/symfony/cache/Traits/AbstractAdapterTrait.php
index eb464c319e..445f8658d7 100644
--- a/vendor/symfony/cache/Traits/AbstractAdapterTrait.php
+++ b/vendor/symfony/cache/Traits/AbstractAdapterTrait.php
@@ -108,6 +108,16 @@ trait AbstractAdapterTrait
return true;
}
+ public function __sleep()
+ {
+ throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ }
+
+ public function __wakeup()
+ {
+ throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ }
+
public function __destruct()
{
if ($this->deferred) {
diff --git a/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherProxyTest.php
index 30bd0c3346..09e5e927e1 100644
--- a/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/LegacyEventDispatcherProxyTest.php
@@ -19,7 +19,7 @@ use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
/**
* @group legacy
*/
-class LegacyEventDispatcherTest extends EventDispatcherTest
+class LegacyEventDispatcherProxyTest extends EventDispatcherTest
{
/**
* @group legacy
diff --git a/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php
index 7a6da17dc0..5d3ae10644 100644
--- a/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php
+++ b/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php
@@ -36,7 +36,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
*
* @param string $cmd The command to run to get the mime type of a file
*/
- public function __construct(string $cmd = 'file -b --mime %s 2>/dev/null')
+ public function __construct(string $cmd = 'file -b --mime -- %s 2>/dev/null')
{
$this->cmd = $cmd;
}
@@ -85,7 +85,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
ob_start();
// need to use --mime instead of -i. see #6641
- passthru(sprintf($this->cmd, escapeshellarg($path)), $return);
+ passthru(sprintf($this->cmd, escapeshellarg((0 === strpos($path, '-') ? './' : '').$path)), $return);
if ($return > 0) {
ob_end_clean();
diff --git a/vendor/symfony/http-foundation/Tests/File/Fixtures/-test b/vendor/symfony/http-foundation/Tests/File/Fixtures/-test
new file mode 100644
index 0000000000..b636f4b8df
--- /dev/null
+++ b/vendor/symfony/http-foundation/Tests/File/Fixtures/-test
Binary files differ
diff --git a/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php b/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php
index a43ce819fb..c566db7693 100644
--- a/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php
+++ b/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php
@@ -21,6 +21,17 @@ use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
*/
class MimeTypeTest extends TestCase
{
+ public function testGuessWithLeadingDash()
+ {
+ $cwd = getcwd();
+ chdir(__DIR__.'/../Fixtures');
+ try {
+ $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess('-test'));
+ } finally {
+ chdir($cwd);
+ }
+ }
+
public function testGuessImageWithoutExtension()
{
$this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test'));
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
index d9314075af..8e2051f7eb 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
@@ -41,12 +41,12 @@ class MockFileSessionStorageTest extends TestCase
protected function tearDown(): void
{
- $this->sessionDir = null;
- $this->storage = null;
- array_map('unlink', glob($this->sessionDir.'/*.session'));
+ array_map('unlink', glob($this->sessionDir.'/*'));
if (is_dir($this->sessionDir)) {
rmdir($this->sessionDir);
}
+ $this->sessionDir = null;
+ $this->storage = null;
}
public function testStart()
diff --git a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php b/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
index 7000e70d5c..e6d5c8ed3c 100644
--- a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
@@ -83,8 +83,8 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
$this->data['symfony_state'] = $this->determineSymfonyState();
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
- $eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
- $eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
+ $eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
+ $eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);
$this->data['symfony_eom'] = $eom->format('F Y');
$this->data['symfony_eol'] = $eol->format('F Y');
}
@@ -330,8 +330,8 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
private function determineSymfonyState()
{
$now = new \DateTime();
- $eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
- $eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)->modify('last day of this month');
+ $eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
+ $eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month');
if ($now > $eol) {
$versionState = 'eol';
diff --git a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php b/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
index b9584110ec..a302ad3009 100644
--- a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
+++ b/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
@@ -24,8 +24,10 @@ interface DataCollectorInterface extends ResetInterface
{
/**
* Collects data for the given Request and Response.
+ *
+ * @param \Throwable|null $exception
*/
- public function collect(Request $request, Response $response, \Exception $exception = null);
+ public function collect(Request $request, Response $response/*, \Throwable $exception = null*/);
/**
* Returns the name of the collector.
diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php
index d91b4f64d9..eca2ab61f1 100644
--- a/vendor/symfony/http-kernel/Kernel.php
+++ b/vendor/symfony/http-kernel/Kernel.php
@@ -73,11 +73,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private $requestStackSize = 0;
private $resetServices = false;
- const VERSION = '4.3.6';
- const VERSION_ID = 40306;
+ const VERSION = '4.3.8';
+ const VERSION_ID = 40308;
const MAJOR_VERSION = 4;
const MINOR_VERSION = 3;
- const RELEASE_VERSION = 6;
+ const RELEASE_VERSION = 8;
const EXTRA_VERSION = '';
const END_OF_MAINTENANCE = '01/2020';
diff --git a/vendor/symfony/http-kernel/Profiler/Profiler.php b/vendor/symfony/http-kernel/Profiler/Profiler.php
index 87a4996392..7a6b927fa0 100644
--- a/vendor/symfony/http-kernel/Profiler/Profiler.php
+++ b/vendor/symfony/http-kernel/Profiler/Profiler.php
@@ -138,10 +138,14 @@ class Profiler implements ResetInterface
/**
* Collects data for the given Response.
*
+ * @param \Throwable|null $exception
+ *
* @return Profile|null A Profile instance or null if the profiler is disabled
*/
- public function collect(Request $request, Response $response, \Exception $exception = null)
+ public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
{
+ $exception = 2 < \func_num_args() ? func_get_arg(2) : null;
+
if (false === $this->enabled) {
return null;
}
diff --git a/vendor/symfony/http-kernel/UriSigner.php b/vendor/symfony/http-kernel/UriSigner.php
index 1dd56ffd76..af8a421371 100644
--- a/vendor/symfony/http-kernel/UriSigner.php
+++ b/vendor/symfony/http-kernel/UriSigner.php
@@ -79,7 +79,7 @@ class UriSigner
$hash = $params[$this->parameter];
unset($params[$this->parameter]);
- return $this->computeHash($this->buildUrl($url, $params)) === $hash;
+ return hash_equals($this->computeHash($this->buildUrl($url, $params)), $hash);
}
private function computeHash($uri)
diff --git a/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php b/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php
index e00ce6525b..59e55f795b 100644
--- a/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php
+++ b/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php
@@ -33,7 +33,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
*
* @param string $cmd The command to run to get the MIME type of a file
*/
- public function __construct(string $cmd = 'file -b --mime %s 2>/dev/null')
+ public function __construct(string $cmd = 'file -b --mime -- %s 2>/dev/null')
{
$this->cmd = $cmd;
}
@@ -76,7 +76,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
ob_start();
// need to use --mime instead of -i. see #6641
- passthru(sprintf($this->cmd, escapeshellarg($path)), $return);
+ passthru(sprintf($this->cmd, escapeshellarg((0 === strpos($path, '-') ? './' : '').$path)), $return);
if ($return > 0) {
ob_end_clean();
diff --git a/vendor/symfony/mime/Tests/AbstractMimeTypeGuesserTest.php b/vendor/symfony/mime/Tests/AbstractMimeTypeGuesserTest.php
index 3ac9382f84..70e419c847 100644
--- a/vendor/symfony/mime/Tests/AbstractMimeTypeGuesserTest.php
+++ b/vendor/symfony/mime/Tests/AbstractMimeTypeGuesserTest.php
@@ -27,6 +27,21 @@ abstract class AbstractMimeTypeGuesserTest extends TestCase
abstract protected function getGuesser(): MimeTypeGuesserInterface;
+ public function testGuessWithLeadingDash()
+ {
+ if (!$this->getGuesser()->isGuesserSupported()) {
+ $this->markTestSkipped('Guesser is not supported');
+ }
+
+ $cwd = getcwd();
+ chdir(__DIR__.'/Fixtures/mimetypes');
+ try {
+ $this->assertEquals('image/gif', $this->getGuesser()->guessMimeType('-test'));
+ } finally {
+ chdir($cwd);
+ }
+ }
+
public function testGuessImageWithoutExtension()
{
if (!$this->getGuesser()->isGuesserSupported()) {
diff --git a/vendor/symfony/mime/Tests/Fixtures/mimetypes/-test b/vendor/symfony/mime/Tests/Fixtures/mimetypes/-test
new file mode 100644
index 0000000000..b636f4b8df
--- /dev/null
+++ b/vendor/symfony/mime/Tests/Fixtures/mimetypes/-test
Binary files differ
diff --git a/vendor/symfony/translation/Tests/TranslatorCacheTest.php b/vendor/symfony/translation/Tests/TranslatorCacheTest.php
index 08add3404b..ae5c75ba82 100644
--- a/vendor/symfony/translation/Tests/TranslatorCacheTest.php
+++ b/vendor/symfony/translation/Tests/TranslatorCacheTest.php
@@ -269,6 +269,22 @@ class TranslatorCacheTest extends TestCase
$translator->trans('foo');
}
+ public function testCachedCatalogueIsReDumpedWhenCacheVaryChange()
+ {
+ $translator = new Translator('a', null, $this->tmpDir, false, []);
+ $translator->addLoader('array', new ArrayLoader());
+ $translator->addResource('array', ['foo' => 'bar'], 'a', 'messages');
+
+ // Cached catalogue is dumped
+ $this->assertSame('bar', $translator->trans('foo', [], 'messages', 'a'));
+
+ $translator = new Translator('a', null, $this->tmpDir, false, ['vary']);
+ $translator->addLoader('array', new ArrayLoader());
+ $translator->addResource('array', ['foo' => 'ccc'], 'a', 'messages');
+
+ $this->assertSame('ccc', $translator->trans('foo', [], 'messages', 'a'));
+ }
+
protected function getCatalogue($locale, $messages, $resources = [])
{
$catalogue = new MessageCatalogue($locale);
diff --git a/vendor/symfony/translation/Translator.php b/vendor/symfony/translation/Translator.php
index 9846c8338b..d9241d5a82 100644
--- a/vendor/symfony/translation/Translator.php
+++ b/vendor/symfony/translation/Translator.php
@@ -71,6 +71,8 @@ class Translator implements LegacyTranslatorInterface, TranslatorInterface, Tran
*/
private $debug;
+ private $cacheVary;
+
/**
* @var ConfigCacheFactoryInterface|null
*/
@@ -86,7 +88,7 @@ class Translator implements LegacyTranslatorInterface, TranslatorInterface, Tran
/**
* @throws InvalidArgumentException If a locale contains invalid characters
*/
- public function __construct(?string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false)
+ public function __construct(?string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = [])
{
$this->setLocale($locale);
@@ -97,6 +99,7 @@ class Translator implements LegacyTranslatorInterface, TranslatorInterface, Tran
$this->formatter = $formatter;
$this->cacheDir = $cacheDir;
$this->debug = $debug;
+ $this->cacheVary = $cacheVary;
$this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface;
}
@@ -176,7 +179,7 @@ class Translator implements LegacyTranslatorInterface, TranslatorInterface, Tran
$this->assertValidLocale($locale);
}
- $this->fallbackLocales = $locales;
+ $this->fallbackLocales = $this->cacheVary['fallback_locales'] = $locales;
}
/**
@@ -392,7 +395,7 @@ EOF
private function getCatalogueCachePath($locale)
{
- return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('sha256', serialize($this->fallbackLocales), true)), 0, 7), '/', '_').'.php';
+ return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('sha256', serialize($this->cacheVary), true)), 0, 7), '/', '_').'.php';
}
/**
diff --git a/vendor/symfony/var-exporter/Internal/Exporter.php b/vendor/symfony/var-exporter/Internal/Exporter.php
index c0b7fa17f4..06d747e138 100644
--- a/vendor/symfony/var-exporter/Internal/Exporter.php
+++ b/vendor/symfony/var-exporter/Internal/Exporter.php
@@ -212,27 +212,28 @@ class Exporter
$subIndent = $indent.' ';
if (\is_string($value)) {
- $code = var_export($value, true);
+ $code = sprintf("'%s'", addcslashes($value, "'\\"));
- if (false !== strpos($value, "\n") || false !== strpos($value, "\r")) {
- $code = strtr($code, [
- "\r\n" => "'.\"\\r\\n\"\n".$subIndent.".'",
- "\r" => "'.\"\\r\"\n".$subIndent.".'",
- "\n" => "'.\"\\n\"\n".$subIndent.".'",
- ]);
- }
+ $code = preg_replace_callback('/([\0\r\n]++)(.)/', function ($m) use ($subIndent) {
+ $m[1] = sprintf('\'."%s".\'', str_replace(
+ ["\0", "\r", "\n", '\n\\'],
+ ['\0', '\r', '\n', '\n"'."\n".$subIndent.'."\\'],
+ $m[1]
+ ));
- if (false !== strpos($value, "\0")) {
- $code = str_replace('\' . "\0" . \'', '\'."\0".\'', $code);
- $code = str_replace('".\'\'."', '', $code);
- }
+ if ("'" === $m[2]) {
+ return substr($m[1], 0, -2);
+ }
- if (false !== strpos($code, "''.")) {
- $code = str_replace("''.", '', $code);
- }
+ if ('n".\'' === substr($m[1], -4)) {
+ return substr_replace($m[1], "\n".$subIndent.".'".$m[2], -2);
+ }
+
+ return $m[1].$m[2];
+ }, $code, -1, $count);
- if (".''" === substr($code, -3)) {
- $code = rtrim(substr($code, 0, -3));
+ if ($count && 0 === strpos($code, "''.")) {
+ $code = substr($code, 3);
}
return $code;
diff --git a/vendor/symfony/var-exporter/Tests/Fixtures/lf-ending-string.php b/vendor/symfony/var-exporter/Tests/Fixtures/lf-ending-string.php
new file mode 100644
index 0000000000..f6bcf84976
--- /dev/null
+++ b/vendor/symfony/var-exporter/Tests/Fixtures/lf-ending-string.php
@@ -0,0 +1,4 @@
+<?php
+
+return '\'BOOM\''."\n"
+ .'.var_dump(123)//\'';
diff --git a/vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php b/vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php
index 540fef0002..5ca94eafdd 100644
--- a/vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php
+++ b/vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php
@@ -2,7 +2,6 @@
return [
"\0\0\r\n"
- .'A' => 'B'."\r"
- .'C'."\n"
+ .'A' => 'B'."\r".'C'."\n"
."\n",
];
diff --git a/vendor/symfony/var-exporter/Tests/VarExporterTest.php b/vendor/symfony/var-exporter/Tests/VarExporterTest.php
index d80c2858ee..1e328d8a50 100644
--- a/vendor/symfony/var-exporter/Tests/VarExporterTest.php
+++ b/vendor/symfony/var-exporter/Tests/VarExporterTest.php
@@ -112,6 +112,7 @@ class VarExporterTest extends TestCase
public function provideExport()
{
yield ['multiline-string', ["\0\0\r\nA" => "B\rC\n\n"], true];
+ yield ['lf-ending-string', "'BOOM'\n.var_dump(123)//'", true];
yield ['bool', true, true];
yield ['simple-array', [123, ['abc']], true];