From 6ddab597f679060f73c189b092529f59d59f8eb0 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Wed, 13 Nov 2019 15:26:23 +0000 Subject: Update vendor dependencies --- .../File/MimeType/FileBinaryMimeTypeGuesser.php | 4 ++-- vendor/symfony/http-foundation/Tests/File/Fixtures/-test | Bin 0 -> 35 bytes .../http-foundation/Tests/File/MimeType/MimeTypeTest.php | 11 +++++++++++ .../Tests/Session/Storage/MockFileSessionStorageTest.php | 6 +++--- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 vendor/symfony/http-foundation/Tests/File/Fixtures/-test (limited to 'vendor/symfony/http-foundation') 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 Binary files /dev/null and b/vendor/symfony/http-foundation/Tests/File/Fixtures/-test 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() -- cgit v1.3