From 5183049b73a3a9fab813e2613233f02106f46d19 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 14 Jan 2019 18:38:02 +0100 Subject: [PATCH 1/3] updated MimeType extensions --- .../MimeType/MimeTypeExtensionGuesser.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php index 77bf51b1e5..d5acb34094 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php @@ -20,11 +20,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface * A map of mime types and their default extensions. * * This list has been placed under the public domain by the Apache HTTPD project. - * This list has been updated from upstream on 2013-04-23. + * This list has been updated from upstream on 2019-01-14. * - * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + * @see https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types */ - protected $defaultExtensions = array( + protected $defaultExtensions = [ 'application/andrew-inset' => 'ez', 'application/applixware' => 'aw', 'application/atom+xml' => 'atom', @@ -618,7 +618,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'audio/adpcm' => 'adp', 'audio/basic' => 'au', 'audio/midi' => 'mid', - 'audio/mp4' => 'mp4a', + 'audio/mp4' => 'm4a', 'audio/mpeg' => 'mpga', 'audio/ogg' => 'oga', 'audio/s3m' => 's3m', @@ -653,6 +653,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'chemical/x-cml' => 'cml', 'chemical/x-csml' => 'csml', 'chemical/x-xyz' => 'xyz', + 'font/collection' => 'ttc', + 'font/otf' => 'otf', + 'font/ttf' => 'ttf', + 'font/woff' => 'woff', + 'font/woff2' => 'woff2', 'image/bmp' => 'bmp', 'image/x-ms-bmp' => 'bmp', 'image/cgm' => 'cgm', @@ -669,8 +674,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'image/tiff' => 'tiff', 'image/vnd.adobe.photoshop' => 'psd', 'image/vnd.dece.graphic' => 'uvi', - 'image/vnd.dvb.subtitle' => 'sub', 'image/vnd.djvu' => 'djvu', + 'image/vnd.dvb.subtitle' => 'sub', 'image/vnd.dwg' => 'dwg', 'image/vnd.dxf' => 'dxf', 'image/vnd.fastbidsheet' => 'fbs', @@ -732,8 +737,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'text/vcard' => 'vcard', 'text/vnd.curl' => 'curl', 'text/vnd.curl.dcurl' => 'dcurl', - 'text/vnd.curl.scurl' => 'scurl', 'text/vnd.curl.mcurl' => 'mcurl', + 'text/vnd.curl.scurl' => 'scurl', 'text/vnd.dvb.subtitle' => 'sub', 'text/vnd.fly' => 'fly', 'text/vnd.fmi.flexstor' => 'flx', @@ -747,10 +752,10 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'text/x-asm' => 's', 'text/x-c' => 'c', 'text/x-fortran' => 'f', - 'text/x-pascal' => 'p', 'text/x-java-source' => 'java', - 'text/x-opml' => 'opml', 'text/x-nfo' => 'nfo', + 'text/x-opml' => 'opml', + 'text/x-pascal' => 'p', 'text/x-setext' => 'etx', 'text/x-sfv' => 'sfv', 'text/x-uuencode' => 'uu', @@ -796,7 +801,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'video/x-sgi-movie' => 'movie', 'video/x-smv' => 'smv', 'x-conference/x-cooltalk' => 'ice', - ); + ]; /** * {@inheritdoc} From 16f97b9769144931f00d7f523c4a35db85299ca3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 15 Jan 2019 14:09:02 +0100 Subject: [PATCH 2/3] remove unreachable code Since our version constraint is `^1.37.1|^2.6.2` any Twig version that is below 2.4.5 must be a Twig 1.x release. --- src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php index 6e61a7d66a..9fe0861376 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php @@ -53,12 +53,8 @@ class TransNodeTest extends TestCase protected function getVariableGetterWithStrictCheck($name) { - if (Environment::VERSION_ID > 20404) { - return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name); - } - if (Environment::MAJOR_VERSION >= 2) { - return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name); + return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name); } if (\PHP_VERSION_ID >= 70000) { From caca373383ba15aae7084a73bb22c68d3f164cd8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 15 Jan 2019 14:43:24 +0100 Subject: [PATCH 3/3] the string "0" is a valid service identifier --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 4 ++-- .../DependencyInjection/Tests/Fixtures/xml/services6.xml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 4236b72f25..4677a61ca4 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -496,7 +496,7 @@ class XmlFileLoader extends FileLoader switch ($arg->getAttribute('type')) { case 'service': - if (!$arg->getAttribute('id')) { + if ('' === $arg->getAttribute('id')) { throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service" has no or empty "id" attribute in "%s".', $name, $file)); } if ($arg->hasAttribute('strict')) { @@ -549,7 +549,7 @@ class XmlFileLoader extends FileLoader * @param \DOMNode $node * @param mixed $name * - * @return array + * @return \DOMElement[] */ private function getChildren(\DOMNode $node, $name) { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml index cffd5df605..c85b7a7c01 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml @@ -61,5 +61,9 @@ + + + +