From b8ada23e2b4252c1d420bbdae5899480c6dd5738 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 19 Jul 2021 22:35:57 -0600 Subject: [PATCH 01/35] fixes #3408 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index fcbcfd7f3..091e9a824 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { } if (PHP_SAPI === 'cli-server') { - $symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'], 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'], 'symfony') !== false; + $symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'] ?? '', 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'] ?? '', 'symfony') !== false; if (!isset($_SERVER['PHP_CLI_ROUTER']) && !$symfony_server) { die("PHP webserver requires a router to run Grav, please use:
php -S {$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']} system/router.php
"); From fdcf7026d2a98ec8f3388520026109a7027708e4 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Tue, 20 Jul 2021 10:48:22 +0300 Subject: [PATCH 02/35] Changelog for #3408 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d6f40d7..8bd90ca7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.19 +## mm/dd/2021 + +1. [](#bugfix) + * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) + # v1.7.18 ## 07/19/2021 From 7b1a188cfe59a54fc70d12f02b9477c71b7ccec4 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 22 Jul 2021 16:59:42 +0300 Subject: [PATCH 03/35] Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409] --- CHANGELOG.md | 1 + system/src/Grav/Framework/Flex/FlexDirectory.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd90ca7d..63c82381b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) + * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index 8d8dd1e64..adbfce6d2 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -241,7 +241,7 @@ class FlexDirectory implements FlexDirectoryInterface if (str_starts_with($uri, 'config://')) { $path = strtr(substr($uri, 9, -5), '/', '.'); - return $grav['config']->get($path); + return (array)$grav['config']->get($path); } // Load the configuration file. From 21f5488d3b81ab965c77be64782bccdb5670474c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 22 Jul 2021 17:00:16 +0300 Subject: [PATCH 04/35] Make MediaUploadTrait::getUploadSettings() public --- .../Common/Media/Traits/MediaUploadTrait.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php index 6da77eee2..fbbfe4170 100644 --- a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php +++ b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php @@ -418,6 +418,17 @@ trait MediaUploadTrait $uploadedFile->moveTo($filepath); } + /** + * Get upload settings. + * + * @param array|null $settings Form field specific settings (override). + * @return array + */ + public function getUploadSettings(?array $settings = null): array + { + return null !== $settings ? $settings + $this->_upload_defaults : $this->_upload_defaults; + } + /** * Internal logic to copy file. * @@ -604,17 +615,6 @@ trait MediaUploadTrait } } - /** - * Get upload settings. - * - * @param array|null $settings Form field specific settings (override). - * @return array - */ - protected function getUploadSettings(?array $settings = null): array - { - return null !== $settings ? $settings + $this->_upload_defaults : $this->_upload_defaults; - } - /** * @param string $filename * @param string $path From 2866a51326623856586a9d6f2eb8cda50ec58e5e Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 22 Jul 2021 17:01:55 +0300 Subject: [PATCH 05/35] Added meta support for `UploadedFile` class --- CHANGELOG.md | 2 ++ .../src/Grav/Framework/Psr7/UploadedFile.php | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c82381b..cf2be09b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.7.19 ## mm/dd/2021 +1. [](#improved) + * Added meta support for `UploadedFile` class 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) diff --git a/system/src/Grav/Framework/Psr7/UploadedFile.php b/system/src/Grav/Framework/Psr7/UploadedFile.php index f13674228..bfa63cdf4 100644 --- a/system/src/Grav/Framework/Psr7/UploadedFile.php +++ b/system/src/Grav/Framework/Psr7/UploadedFile.php @@ -23,6 +23,9 @@ class UploadedFile implements UploadedFileInterface { use UploadedFileDecoratorTrait; + /** @var array */ + private $meta = []; + /** * @param StreamInterface|string|resource $streamOrFile * @param int $size @@ -34,4 +37,34 @@ class UploadedFile implements UploadedFileInterface { $this->uploadedFile = new \Nyholm\Psr7\UploadedFile($streamOrFile, $size, $errorStatus, $clientFilename, $clientMediaType); } + + /** + * @param array $meta + * @return $this + */ + public function setMeta(array $meta) + { + $this->meta = $meta; + + return $this; + } + + /** + * @param array $meta + * @return $this + */ + public function addMeta(array $meta) + { + $this->meta = array_merge($this->meta, $meta); + + return $this; + } + + /** + * @return array + */ + public function getMeta(): array + { + return $this->meta; + } } From c57a29c23f36e5e22228c73e80d3d6f4be19e48e Mon Sep 17 00:00:00 2001 From: Karmalakas Date: Tue, 6 Jul 2021 21:14:06 +0300 Subject: [PATCH 06/35] Add `setCurrent()` method to Page Collection #531 --- system/src/Grav/Common/Page/Collection.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/src/Grav/Common/Page/Collection.php b/system/src/Grav/Common/Page/Collection.php index 139a58bc5..a37f46a27 100644 --- a/system/src/Grav/Common/Page/Collection.php +++ b/system/src/Grav/Common/Page/Collection.php @@ -145,6 +145,18 @@ class Collection extends Iterator implements PageCollectionInterface return $this; } + /** + * Set current page. + */ + public function setCurrent(string $path): void + { + reset($this->items); + + while (key($this->items) !== $path && key($this->items) !== null) { + next($this->items); + } + } + /** * Returns current page. * From 6dd5e0fd20b7bf49490d35e57affb2c35c719917 Mon Sep 17 00:00:00 2001 From: Karmalakas Date: Fri, 9 Jul 2021 00:29:54 +0300 Subject: [PATCH 07/35] Change key setting in a loop #531 --- system/src/Grav/Common/Page/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Collection.php b/system/src/Grav/Common/Page/Collection.php index a37f46a27..c9a3cdbd5 100644 --- a/system/src/Grav/Common/Page/Collection.php +++ b/system/src/Grav/Common/Page/Collection.php @@ -152,7 +152,7 @@ class Collection extends Iterator implements PageCollectionInterface { reset($this->items); - while (key($this->items) !== $path && key($this->items) !== null) { + while (($key = key($this->items)) !== null && $key !== $path) { next($this->items); } } From d62e869044f865c691b4c10e74a485bd01735cc0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 22 Jul 2021 17:17:15 +0300 Subject: [PATCH 08/35] Add changelog [#3398] --- CHANGELOG.md | 1 + .../src/Grav/Common/Flex/Types/Pages/PageCollection.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2be09b5..32d0a83bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#improved) * Added meta support for `UploadedFile` class + * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php b/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php index 0c23134c7..08f192fe7 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php @@ -192,6 +192,14 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa throw new RuntimeException(__METHOD__ . '(): Not Implemented'); } + /** + * Set current page. + */ + public function setCurrent(string $path): void + { + throw new RuntimeException(__METHOD__ . '(): Not Implemented'); + } + /** * Return previous item. * From a8a8cce25f2e6b6a2754fa73c0652fb774ef0a1b Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 23 Jul 2021 09:39:21 +0300 Subject: [PATCH 09/35] Fixed GPM not using non-standard cache path [#3410] --- CHANGELOG.md | 1 + system/src/Grav/Common/GPM/GPM.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32d0a83bc..81855809e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) + * Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410) # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/GPM/GPM.php b/system/src/Grav/Common/GPM/GPM.php index dfed77a14..450569632 100644 --- a/system/src/Grav/Common/GPM/GPM.php +++ b/system/src/Grav/Common/GPM/GPM.php @@ -60,7 +60,7 @@ class GPM extends Iterator { parent::__construct(); - Folder::create(GRAV_ROOT . '/cache/gpm'); + Folder::create(CACHE_DIR . '/gpm'); $this->cache = []; $this->installed = new Local\Packages(); From ab9783102e0a49d54ae7e1a43902a6d38b978f6c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 23 Jul 2021 21:51:17 +0300 Subject: [PATCH 10/35] Fixed broken `environment://` stream when it doesn't have configuration --- CHANGELOG.md | 1 + system/src/Grav/Common/Config/Setup.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81855809e..2940eb9be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) * Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410) + * Fixed broken `environment://` stream when it doesn't have configuration # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/Config/Setup.php b/system/src/Grav/Common/Config/Setup.php index 5693a921f..2fa4a982c 100644 --- a/system/src/Grav/Common/Config/Setup.php +++ b/system/src/Grav/Common/Config/Setup.php @@ -390,7 +390,10 @@ class Setup extends Data if (!$locator->findResource('environment://config', true)) { // If environment does not have its own directory, remove it from the lookup. - $this->set('streams.schemes.environment.prefixes', ['config' => []]); + $prefixes = $this->get('streams.schemes.environment.prefixes'); + $prefixes['config'] = []; + + $this->set('streams.schemes.environment.prefixes', $prefixes); $this->initializeLocator($locator); } From 506c74de55da632b361c9bc054d49087fa84bd58 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 26 Jul 2021 14:39:40 +0300 Subject: [PATCH 11/35] Include active form in `onPageTask` and `onPageAction` events (defaults to `null`) --- CHANGELOG.md | 2 ++ system/src/Grav/Common/Processors/PagesProcessor.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2940eb9be..244f41da5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.7.19 ## mm/dd/2021 +1. [](#new) + * Include active form in `onPageTask` and `onPageAction` events (defaults to `null`) 1. [](#improved) * Added meta support for `UploadedFile` class * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) diff --git a/system/src/Grav/Common/Processors/PagesProcessor.php b/system/src/Grav/Common/Processors/PagesProcessor.php index 33b483fbd..60775aacf 100644 --- a/system/src/Grav/Common/Processors/PagesProcessor.php +++ b/system/src/Grav/Common/Processors/PagesProcessor.php @@ -10,6 +10,7 @@ namespace Grav\Common\Processors; use Grav\Common\Page\Interfaces\PageInterface; +use Grav\Plugin\Form\Forms; use RocketTheme\Toolbox\Event\Event; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -65,12 +66,17 @@ class PagesProcessor extends ProcessorBase $task = $this->container['task']; $action = $this->container['action']; + + /** @var Forms $forms */ + $forms = $this->container['forms'] ?? null; + $form = $forms ? $forms->getActiveForm() : null; + if ($task) { - $event = new Event(['task' => $task, 'page' => $page]); + $event = new Event(['task' => $task, 'page' => $page, 'form' => $form]); $this->container->fireEvent('onPageTask', $event); $this->container->fireEvent('onPageTask.' . $task, $event); } elseif ($action) { - $event = new Event(['action' => $action, 'page' => $page]); + $event = new Event(['action' => $action, 'page' => $page, 'form' => $form]); $this->container->fireEvent('onPageAction', $event); $this->container->fireEvent('onPageAction.' . $action, $event); } From 7c946c59f82e8b2c7b99f52ad975adbe3da49ef2 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 26 Jul 2021 17:27:30 +0300 Subject: [PATCH 12/35] Include request in `onPageTask` and `onPageAction` events (defaults to `null`) --- CHANGELOG.md | 2 +- system/src/Grav/Common/Processors/PagesProcessor.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 244f41da5..f8f6dd43c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## mm/dd/2021 1. [](#new) - * Include active form in `onPageTask` and `onPageAction` events (defaults to `null`) + * Include active form and request in `onPageTask` and `onPageAction` events (defaults to `null`) 1. [](#improved) * Added meta support for `UploadedFile` class * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) diff --git a/system/src/Grav/Common/Processors/PagesProcessor.php b/system/src/Grav/Common/Processors/PagesProcessor.php index 60775aacf..d5d1d4667 100644 --- a/system/src/Grav/Common/Processors/PagesProcessor.php +++ b/system/src/Grav/Common/Processors/PagesProcessor.php @@ -71,12 +71,13 @@ class PagesProcessor extends ProcessorBase $forms = $this->container['forms'] ?? null; $form = $forms ? $forms->getActiveForm() : null; + $options = ['page' => $page, 'form' => $form, 'request' => $request]; if ($task) { - $event = new Event(['task' => $task, 'page' => $page, 'form' => $form]); + $event = new Event(['task' => $task] + $options); $this->container->fireEvent('onPageTask', $event); $this->container->fireEvent('onPageTask.' . $task, $event); } elseif ($action) { - $event = new Event(['action' => $action, 'page' => $page, 'form' => $form]); + $event = new Event(['action' => $action] + $options); $this->container->fireEvent('onPageAction', $event); $this->container->fireEvent('onPageAction.' . $action, $event); } From e390e9901ecf3d3fa154e940e84f8f87929ae42c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 28 Jul 2021 14:29:10 +0300 Subject: [PATCH 13/35] Allow customization of security.yaml --- system/src/Grav/Common/Config/Setup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Config/Setup.php b/system/src/Grav/Common/Config/Setup.php index 2fa4a982c..83a276395 100644 --- a/system/src/Grav/Common/Config/Setup.php +++ b/system/src/Grav/Common/Config/Setup.php @@ -41,6 +41,9 @@ class Setup extends Data */ public static $environment; + /** @var string */ + public static $securityFile = 'config://security.yaml'; + /** @var array */ protected $streams = [ 'user' => [ @@ -398,7 +401,7 @@ class Setup extends Data } // Create security.yaml if it doesn't exist. - $filename = $locator->findResource('config://security.yaml', true, true); + $filename = $locator->findResource(static::$securityFile, true, true); $security_file = CompiledYamlFile::instance($filename); $security_content = (array)$security_file->content(); From 5437d2db1ab2ca214f03652d2845309a39db10ef Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 28 Jul 2021 14:31:55 +0300 Subject: [PATCH 14/35] Fixed `Flex Object` missing key field value when using `FolderStorage` --- CHANGELOG.md | 1 + system/src/Grav/Framework/Flex/Storage/FolderStorage.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f6dd43c..f5467bd8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) * Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410) * Fixed broken `environment://` stream when it doesn't have configuration + * Fixed `Flex Object` missing key field value when using `FolderStorage` # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Framework/Flex/Storage/FolderStorage.php b/system/src/Grav/Framework/Flex/Storage/FolderStorage.php index 229194d7c..dc9649525 100644 --- a/system/src/Grav/Framework/Flex/Storage/FolderStorage.php +++ b/system/src/Grav/Framework/Flex/Storage/FolderStorage.php @@ -380,6 +380,12 @@ class FolderStorage extends AbstractFilesystemStorage if (isset($data[0])) { throw new RuntimeException('Broken object file'); } + + // Add key field to the object. + $keyField = $this->keyField; + if ($keyField !== 'storage_key' && !isset($data[$keyField])) { + $data[$keyField] = $key; + } } catch (RuntimeException $e) { $data = ['__ERROR' => $e->getMessage()]; } finally { From 17d1786e5c5add04aa400ee2eab7b9f2409ae413 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 29 Jul 2021 16:12:14 +0300 Subject: [PATCH 15/35] Fixed broken Twig try tag when catch has not been defined or is empty --- CHANGELOG.md | 1 + .../Grav/Common/Twig/Node/TwigNodeTryCatch.php | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5467bd8c..31f12f0af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410) * Fixed broken `environment://` stream when it doesn't have configuration * Fixed `Flex Object` missing key field value when using `FolderStorage` + * Fixed broken Twig try tag when catch has not been defined or is empty # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/Twig/Node/TwigNodeTryCatch.php b/system/src/Grav/Common/Twig/Node/TwigNodeTryCatch.php index da95a1d98..40e9240f3 100644 --- a/system/src/Grav/Common/Twig/Node/TwigNodeTryCatch.php +++ b/system/src/Grav/Common/Twig/Node/TwigNodeTryCatch.php @@ -49,16 +49,15 @@ class TwigNodeTryCatch extends Node $compiler ->indent() - ->subcompile($this->getNode('try')); + ->subcompile($this->getNode('try')) + ->outdent() + ->write('} catch (\Exception $e) {' . "\n") + ->indent() + ->write('if (isset($context[\'grav\'][\'debugger\'])) $context[\'grav\'][\'debugger\']->addException($e);' . "\n") + ->write('$context[\'e\'] = $e;' . "\n"); if ($this->hasNode('catch')) { - $compiler - ->outdent() - ->write('} catch (\Exception $e) {' . "\n") - ->indent() - ->write('if (isset($context[\'grav\'][\'debugger\'])) $context[\'grav\'][\'debugger\']->addException($e);' . "\n") - ->write('$context[\'e\'] = $e;' . "\n") - ->subcompile($this->getNode('catch')); + $compiler->subcompile($this->getNode('catch')); } $compiler From c9159695aa0390bcc8d4970bdfde29337e98aec7 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 29 Jul 2021 19:59:42 +0300 Subject: [PATCH 16/35] Fixed `FlexForm` serialization --- CHANGELOG.md | 1 + system/src/Grav/Framework/Flex/FlexForm.php | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31f12f0af..f30e33f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Fixed broken `environment://` stream when it doesn't have configuration * Fixed `Flex Object` missing key field value when using `FolderStorage` * Fixed broken Twig try tag when catch has not been defined or is empty + * Fixed `FlexForm` serialization # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Framework/Flex/FlexForm.php b/system/src/Grav/Framework/Flex/FlexForm.php index 192f38fec..3625189b2 100644 --- a/system/src/Grav/Framework/Flex/FlexForm.php +++ b/system/src/Grav/Framework/Flex/FlexForm.php @@ -103,7 +103,14 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable { $this->name = $name; $this->setObject($object); - $this->setName($object->getFlexType(), $name); + + if (isset($options['form']['name'])) { + // Use custom form name. + $this->flexName = $options['form']['name']; + } else { + // Use standard form name. + $this->setName($object->getFlexType(), $name); + } $this->setId($this->getName()); $uniqueId = $options['unique_id'] ?? null; @@ -536,7 +543,11 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable protected function doSerialize(): array { return $this->doTraitSerialize() + [ + 'items' => $this->items, + 'form' => $this->form, 'object' => $this->object, + 'flexName' => $this->flexName, + 'submitMethod' => $this->submitMethod, ]; } @@ -548,7 +559,11 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable { $this->doTraitUnserialize($data); - $this->object = $data['object']; + $this->items = $data['items'] ?? null; + $this->form = $data['form'] ?? null; + $this->object = $data['object'] ?? null; + $this->flexName = $data['flexName'] ?? null; + $this->submitMethod = $data['submitMethod'] ?? null; } /** From c5dfa65994cd5fff07af2af63c130eb6725d9604 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 29 Jul 2021 22:14:45 +0300 Subject: [PATCH 17/35] Fixed `FlexDirectoryForm` serialization --- system/src/Grav/Framework/Flex/FlexDirectoryForm.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/src/Grav/Framework/Flex/FlexDirectoryForm.php b/system/src/Grav/Framework/Flex/FlexDirectoryForm.php index ba26b6319..e095a5d8f 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectoryForm.php +++ b/system/src/Grav/Framework/Flex/FlexDirectoryForm.php @@ -453,7 +453,9 @@ class FlexDirectoryForm implements FlexDirectoryFormInterface, JsonSerializable protected function doSerialize(): array { return $this->doTraitSerialize() + [ + 'form' => $this->form, 'directory' => $this->directory, + 'flexName' => $this->flexName ]; } @@ -465,7 +467,9 @@ class FlexDirectoryForm implements FlexDirectoryFormInterface, JsonSerializable { $this->doTraitUnserialize($data); + $this->form = $data['form']; $this->directory = $data['directory']; + $this->flexName = $data['flexName']; } /** From def389356e392f61605647b4814174fb7a6cf8a5 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 29 Jul 2021 23:09:25 +0300 Subject: [PATCH 18/35] Added `UserObject::$authorizeCallable` to allow `$user->authorize()` customization --- CHANGELOG.md | 1 + .../src/Grav/Common/Flex/Types/Users/UserObject.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f30e33f5d..2bc2c9dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#new) * Include active form and request in `onPageTask` and `onPageAction` events (defaults to `null`) + * Added `UserObject::$authorizeCallable` to allow `$user->authorize()` customization 1. [](#improved) * Added meta support for `UploadedFile` class * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) diff --git a/system/src/Grav/Common/Flex/Types/Users/UserObject.php b/system/src/Grav/Common/Flex/Types/Users/UserObject.php index 62305cd8d..82b9f7c4f 100644 --- a/system/src/Grav/Common/Flex/Types/Users/UserObject.php +++ b/system/src/Grav/Common/Flex/Types/Users/UserObject.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Grav\Common\Flex\Types\Users; +use Closure; use Countable; use Grav\Common\Config\Config; use Grav\Common\Data\Blueprint; @@ -75,6 +76,9 @@ class UserObject extends FlexObject implements UserInterface, Countable use UserTrait; use UserObjectLegacyTrait; + /** @var Closure|null */ + static public $authorizeCallable; + /** @var array|null */ protected $_uploads_original; /** @var FileInterface|null */ @@ -259,6 +263,15 @@ class UserObject extends FlexObject implements UserInterface, Countable } } + $authorizeCallable = static::$authorizeCallable; + if ($authorizeCallable instanceof Closure) { + $authorizeCallable->bindTo($this); + $authorized = $authorizeCallable($action, $scope); + if (is_bool($authorized)) { + return $authorized; + } + } + // Check user access. $access = $this->getAccess(); $authorized = $access->authorize($action, $scope); From 2e9fe80e33b1f6a80b061239fe2f425aa1f54b06 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 30 Jul 2021 09:31:33 +0300 Subject: [PATCH 19/35] Initialize `$grav['uri]` before session --- CHANGELOG.md | 1 + system/src/Grav/Common/Processors/InitializeProcessor.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc2c9dfa..7ca6d31ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ 1. [](#improved) * Added meta support for `UploadedFile` class * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) + * Initialize `$grav['uri]` before session 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) diff --git a/system/src/Grav/Common/Processors/InitializeProcessor.php b/system/src/Grav/Common/Processors/InitializeProcessor.php index cc8e4f260..61144648c 100644 --- a/system/src/Grav/Common/Processors/InitializeProcessor.php +++ b/system/src/Grav/Common/Processors/InitializeProcessor.php @@ -105,12 +105,12 @@ class InitializeProcessor extends ProcessorBase // TODO: remove in 2.0. $this->container['accounts']; - // Initialize session. - $this->initializeSession($config); - // Initialize URI (uses session, see issue #3269). $this->initializeUri($config); + // Initialize session. + $this->initializeSession($config); + // Grav may return redirect response right away. $redirectCode = (int)$config->get('system.pages.redirect_trailing_slash', 1); if ($redirectCode) { From b3af6c992011734b5f8ddd6480de595c0d0a3e74 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 31 Jul 2021 22:29:22 +0200 Subject: [PATCH 20/35] Change mime-type to text/javascript (#3415) Recommended by whatwg and draft-ietf-dispatch-javascript-mjs-09 (obsoletes RFC4329) --- system/config/media.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/config/media.yaml b/system/config/media.yaml index e5439d6d8..9c9918af2 100644 --- a/system/config/media.yaml +++ b/system/config/media.yaml @@ -207,7 +207,7 @@ types: js: type: file thumb: media/thumb-js.png - mime: application/javascript + mime: text/javascript json: type: file thumb: media/thumb-json.png From b3e968251116ef22a7550b82acf4a4946c765727 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 9 Aug 2021 19:36:14 +0300 Subject: [PATCH 21/35] Generalize FolderStorage templating --- system/src/Grav/Framework/Flex/Storage/FolderStorage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Framework/Flex/Storage/FolderStorage.php b/system/src/Grav/Framework/Flex/Storage/FolderStorage.php index dc9649525..5b4f9f386 100644 --- a/system/src/Grav/Framework/Flex/Storage/FolderStorage.php +++ b/system/src/Grav/Framework/Flex/Storage/FolderStorage.php @@ -40,6 +40,8 @@ class FolderStorage extends AbstractFilesystemStorage protected $dataFolder; /** @var string Pattern to access an object. */ protected $dataPattern = '{FOLDER}/{KEY}/{FILE}{EXT}'; + /** @var string[] */ + protected $variables = ['FOLDER' => '%1$s', 'KEY' => '%2$s', 'KEY:2' => '%3$s', 'FILE' => '%4$s', 'EXT' => '%5$s']; /** @var string Filename for the object. */ protected $dataFile; /** @var string File extension for the object. */ @@ -698,9 +700,7 @@ class FolderStorage extends AbstractFilesystemStorage $this->keyLen = (int)($options['key_len'] ?? 32); $this->caseSensitive = (bool)($options['case_sensitive'] ?? true); - $variables = ['FOLDER' => '%1$s', 'KEY' => '%2$s', 'KEY:2' => '%3$s', 'FILE' => '%4$s', 'EXT' => '%5$s']; - $pattern = Utils::simpleTemplate($pattern, $variables); - + $pattern = Utils::simpleTemplate($pattern, $this->variables); if (!$pattern) { throw new RuntimeException('Bad storage folder pattern'); } From 9333fcc1d6f9f80b85eeacf4ab94ccda348361d0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 9 Aug 2021 21:38:01 +0300 Subject: [PATCH 22/35] Generalize FolderStorage templating --- CHANGELOG.md | 1 + system/src/Grav/Common/Data/Validation.php | 25 ++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ca6d31ba..1f25ef3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Fixed `Flex Object` missing key field value when using `FolderStorage` * Fixed broken Twig try tag when catch has not been defined or is empty * Fixed `FlexForm` serialization + * Fixed form validation for numeric values in PHP 8 # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index bb3fdd18c..f69c841fc 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -519,17 +519,30 @@ class Validation return false; } - if (isset($params['min']) && $value < $params['min']) { - return false; + $value = (float)$value; + + $min = 0; + if (isset($params['min'])) { + $min = (float)$params['min']; + if ($value < $min) { + return false; + } } - if (isset($params['max']) && $value > $params['max']) { - return false; + if (isset($params['max'])) { + $max = (float)$params['max']; + if ($value > $max) { + return false; + } } - $min = $params['min'] ?? 0; + if (isset($params['step'])) { + $step = (float)$params['step']; - return !(isset($params['step']) && fmod($value - $min, $params['step']) === 0); + return fmod($value - $min, $step) === 0.0; + } + + return true; } /** From a9b59596d837a28d20b63755bf16c481ace32e27 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Tue, 10 Aug 2021 12:38:07 +0300 Subject: [PATCH 23/35] Fixed `flex-options@` in blueprints duplicating items in array --- CHANGELOG.md | 1 + .../src/Grav/Framework/Flex/FlexDirectory.php | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f25ef3df..ab57d9166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Fixed broken Twig try tag when catch has not been defined or is empty * Fixed `FlexForm` serialization * Fixed form validation for numeric values in PHP 8 + * Fixed `flex-options@` in blueprints duplicating items in array # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index adbfce6d2..402c9746d 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -831,7 +831,7 @@ class FlexDirectory implements FlexDirectoryInterface * @param array $call * @return void */ - protected function dynamicFlexField(array &$field, $property, array $call) + protected function dynamicFlexField(array &$field, $property, array $call): void { $params = (array)$call['params']; $object = $call['object'] ?? null; @@ -840,11 +840,28 @@ class FlexDirectory implements FlexDirectoryInterface if ($object && method_exists($object, $method)) { $value = $object->{$method}(...$params); if (is_array($value) && isset($field[$property]) && is_array($field[$property])) { - $field[$property] = array_merge_recursive($field[$property], $value); + $value = $this->mergeArrays($field[$property], $value); + } + $field[$property] = $value; + } + } + + /** + * @param array $array1 + * @param array $array2 + * @return array + */ + protected function mergeArrays(array $array1, array $array2): array + { + foreach ($array2 as $key => $value) { + if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) { + $array1[$key] = $this->mergeArrays($array1[$key], $value); } else { - $field[$property] = $value; + $array1[$key] = $value; } } + + return $array1; } /** From c975f894ae3962e58b5f614208c515b9636cb4be Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 11 Aug 2021 09:07:57 +0300 Subject: [PATCH 24/35] Composer update --- composer.lock | 366 +++++++++--------- .../Framework/Flex/Traits/FlexMediaTrait.php | 2 +- 2 files changed, 188 insertions(+), 180 deletions(-) diff --git a/composer.lock b/composer.lock index 7c2734215..f06c4a601 100644 --- a/composer.lock +++ b/composer.lock @@ -212,24 +212,23 @@ }, { "name": "doctrine/cache", - "version": "1.11.3", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "3bb5588cec00a0268829cc4a518490df6741af9d" + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/3bb5588cec00a0268829cc4a518490df6741af9d", - "reference": "3bb5588cec00a0268829cc4a518490df6741af9d", + "url": "https://api.github.com/repos/doctrine/cache/zipball/4cf401d14df219fa6f38b671f5493449151c9ad8", + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8", "shasum": "" }, "require": { "php": "~7.1 || ^8.0" }, "conflict": { - "doctrine/common": ">2.2,<2.4", - "psr/cache": ">=3" + "doctrine/common": ">2.2,<2.4" }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", @@ -238,8 +237,9 @@ "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "predis/predis": "~1.0", - "psr/cache": "^1.0 || ^2.0", - "symfony/cache": "^4.4 || ^5.2" + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", + "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" @@ -291,7 +291,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.11.3" + "source": "https://github.com/doctrine/cache/tree/1.12.1" }, "funding": [ { @@ -307,7 +307,7 @@ "type": "tidelift" } ], - "time": "2021-05-25T09:01:55+00:00" + "time": "2021-07-17T14:39:21+00:00" }, { "name": "doctrine/collections", @@ -495,25 +495,26 @@ }, { "name": "enshrined/svg-sanitize", - "version": "0.14.0", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "beff89576a72540ee99476aeb9cfe98222e76fb8" + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/beff89576a72540ee99476aeb9cfe98222e76fb8", - "reference": "beff89576a72540ee99476aeb9cfe98222e76fb8", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/307b42066fb0b76b5119f5e1f0826e18fefabe95", + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95", "shasum": "" }, "require": { "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "php": "^7.0 || ^8.0" }, "require-dev": { "codeclimate/php-test-reporter": "^0.1.2", - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^6.5 || ^8.5" }, "type": "library", "autoload": { @@ -534,9 +535,9 @@ "description": "An SVG sanitizer for PHP", "support": { "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.0" + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.1" }, - "time": "2021-01-21T10:13:20+00:00" + "time": "2021-08-09T23:46:54+00:00" }, { "name": "erusev/parsedown", @@ -641,16 +642,16 @@ }, { "name": "filp/whoops", - "version": "2.13.0", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "2edbc73a4687d9085c8f20f398eebade844e8424" + "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/2edbc73a4687d9085c8f20f398eebade844e8424", - "reference": "2edbc73a4687d9085c8f20f398eebade844e8424", + "url": "https://api.github.com/repos/filp/whoops/zipball/fdf92f03e150ed84d5967a833ae93abffac0315b", + "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b", "shasum": "" }, "require": { @@ -700,7 +701,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.13.0" + "source": "https://github.com/filp/whoops/tree/2.14.0" }, "funding": [ { @@ -708,7 +709,7 @@ "type": "github" } ], - "time": "2021-06-04T12:00:00+00:00" + "time": "2021-07-13T12:00:00+00:00" }, { "name": "getgrav/cache", @@ -898,16 +899,16 @@ }, { "name": "itsgoingd/clockwork", - "version": "v5.0.8", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/itsgoingd/clockwork.git", - "reference": "01686ebbf75d8e121dfb1b60e52f334858793830" + "reference": "b963dee47429a49c9669981cfa9a8362ce209278" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/01686ebbf75d8e121dfb1b60e52f334858793830", - "reference": "01686ebbf75d8e121dfb1b60e52f334858793830", + "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/b963dee47429a49c9669981cfa9a8362ce209278", + "reference": "b963dee47429a49c9669981cfa9a8362ce209278", "shasum": "" }, "require": { @@ -955,7 +956,7 @@ ], "support": { "issues": "https://github.com/itsgoingd/clockwork/issues", - "source": "https://github.com/itsgoingd/clockwork/tree/v5.0.8" + "source": "https://github.com/itsgoingd/clockwork/tree/v5.1.0" }, "funding": [ { @@ -963,7 +964,7 @@ "type": "github" } ], - "time": "2021-04-27T22:00:25+00:00" + "time": "2021-08-07T23:04:17+00:00" }, { "name": "league/climate", @@ -1163,16 +1164,16 @@ }, { "name": "maximebf/debugbar", - "version": "v1.16.5", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62" + "reference": "0a3532556be0145603f8a9de23e76dc28eed7054" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6d51ee9e94cff14412783785e79a4e7ef97b9d62", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0a3532556be0145603f8a9de23e76dc28eed7054", + "reference": "0a3532556be0145603f8a9de23e76dc28eed7054", "shasum": "" }, "require": { @@ -1191,7 +1192,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -1222,9 +1223,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.5" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.17.1" }, - "time": "2020-12-07T11:07:24+00:00" + "time": "2021-08-01T09:19:02+00:00" }, { "name": "miljar/php-exif", @@ -1374,16 +1375,16 @@ }, { "name": "nyholm/psr7", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b" + "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/23ae1f00fbc6a886cbe3062ca682391b9cc7c37b", - "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/2212385b47153ea71b1c1b1374f8cb5e4f7892ec", + "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec", "shasum": "" }, "require": { @@ -1397,7 +1398,7 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "http-interop/http-factory-tests": "^0.8", + "http-interop/http-factory-tests": "^0.9", "php-http/psr7-integration-tests": "^1.0", "phpunit/phpunit": "^7.5 || 8.5 || 9.4", "symfony/error-handler": "^4.4" @@ -1435,7 +1436,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.4.0" + "source": "https://github.com/Nyholm/psr7/tree/1.4.1" }, "funding": [ { @@ -1447,7 +1448,7 @@ "type": "github" } ], - "time": "2021-02-18T15:41:32+00:00" + "time": "2021-07-02T08:32:20+00:00" }, { "name": "nyholm/psr7-server", @@ -2257,36 +2258,37 @@ }, { "name": "symfony/console", - "version": "v4.4.25", + "version": "v4.4.29", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095" + "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a62acecdf5b50e314a4f305cd01b5282126f3095", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095", + "url": "https://api.github.com/repos/symfony/console/zipball/8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", + "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<3.4", "symfony/event-dispatcher": "<4.3|>=5", "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/event-dispatcher": "^4.3", @@ -2326,7 +2328,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.25" + "source": "https://github.com/symfony/console/tree/v4.4.29" }, "funding": [ { @@ -2342,7 +2344,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-07-27T19:04:53+00:00" }, { "name": "symfony/contracts", @@ -2440,21 +2442,22 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.25", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f" + "reference": "958a128b184fcf0ba45ec90c0e88554c9327c2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/047773e7016e4fd45102cedf4bd2558ae0d0c32f", - "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/958a128b184fcf0ba45ec90c0e88554c9327c2e9", + "reference": "958a128b184fcf0ba45ec90c0e88554c9327c2e9", "shasum": "" }, "require": { "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "symfony/event-dispatcher-contracts": "^1.1", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/dependency-injection": "<3.4" @@ -2464,7 +2467,7 @@ "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/error-handler": "~3.4|~4.4", @@ -2503,7 +2506,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.25" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.27" }, "funding": [ { @@ -2519,27 +2522,28 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-07-23T15:41:52+00:00" }, { "name": "symfony/http-client", - "version": "v4.4.25", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "00bb90bfb0b3823f700d7251735dced581f9dd90" + "reference": "ade6979785bb799e08912f3104959fb169739462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/00bb90bfb0b3823f700d7251735dced581f9dd90", - "reference": "00bb90bfb0b3823f700d7251735dced581f9dd90", + "url": "https://api.github.com/repos/symfony/http-client/zipball/ade6979785bb799e08912f3104959fb169739462", + "reference": "ade6979785bb799e08912f3104959fb169739462", "shasum": "" }, "require": { "php": ">=7.1.3", - "psr/log": "^1.0", + "psr/log": "^1|^2|^3", "symfony/http-client-contracts": "^1.1.10|^2", "symfony/polyfill-php73": "^1.11", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.0|^2" }, "provide": { @@ -2583,7 +2587,7 @@ "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v4.4.25" + "source": "https://github.com/symfony/http-client/tree/v4.4.27" }, "funding": [ { @@ -2599,7 +2603,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-07-23T15:41:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2762,16 +2766,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -2822,7 +2826,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -2838,7 +2842,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php74", @@ -2922,16 +2926,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -2985,7 +2989,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -3001,24 +3005,25 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/process", - "version": "v4.4.25", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9" + "reference": "0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cd61e6dd273975c6625316de9d141ebd197f93c9", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9", + "url": "https://api.github.com/repos/symfony/process/zipball/0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f", + "reference": "0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3046,7 +3051,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.25" + "source": "https://github.com/symfony/process/tree/v4.4.27" }, "funding": [ { @@ -3062,27 +3067,27 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-07-23T15:41:52+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.4.25", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", @@ -3135,7 +3140,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.27" }, "funding": [ { @@ -3151,20 +3156,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:48:32+00:00" + "time": "2021-07-23T15:41:52+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.25", + "version": "v4.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc" + "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", - "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", + "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", "shasum": "" }, "require": { @@ -3206,7 +3211,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.25" + "source": "https://github.com/symfony/yaml/tree/v4.4.29" }, "funding": [ { @@ -3222,7 +3227,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-07-27T16:19:30+00:00" }, { "name": "twig/twig", @@ -3426,16 +3431,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.21", + "version": "4.1.22", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "c25f20d842a7e3fa0a8e6abf0828f102c914d419" + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c25f20d842a7e3fa0a8e6abf0828f102c914d419", - "reference": "c25f20d842a7e3fa0a8e6abf0828f102c914d419", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", "shasum": "" }, "require": { @@ -3446,7 +3451,7 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/psr7": "~1.4", + "guzzlehttp/psr7": "^1.4 | ^2.0", "php": ">=5.6.0 <9.0", "symfony/console": ">=2.7 <6.0", "symfony/css-selector": ">=2.7 <6.0", @@ -3509,7 +3514,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.1.21" + "source": "https://github.com/Codeception/Codeception/tree/4.1.22" }, "funding": [ { @@ -3517,7 +3522,7 @@ "type": "open_collective" } ], - "time": "2021-05-28T17:43:39+00:00" + "time": "2021-08-06T17:15:34+00:00" }, { "name": "codeception/lib-asserts", @@ -4172,16 +4177,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.10.5", + "version": "v4.12.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f" + "reference": "6608f01670c3cc5079e18c1dab1104e002579143" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f", - "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143", "shasum": "" }, "require": { @@ -4222,22 +4227,22 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" }, - "time": "2021-05-03T19:11:20+00:00" + "time": "2021-07-21T10:44:31+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -4282,9 +4287,9 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2020-06-27T14:33:11+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", @@ -4564,16 +4569,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.89", + "version": "0.12.94", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "54c0f5a6c30511b77128d58b6369f718df250542" + "reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/54c0f5a6c30511b77128d58b6369f718df250542", - "reference": "54c0f5a6c30511b77128d58b6369f718df250542", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6", + "reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6", "shasum": "" }, "require": { @@ -4604,7 +4609,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.89" + "source": "https://github.com/phpstan/phpstan/tree/0.12.94" }, "funding": [ { @@ -4624,7 +4629,7 @@ "type": "tidelift" } ], - "time": "2021-06-09T20:23:49+00:00" + "time": "2021-07-30T09:05:27+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -4997,16 +5002,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.5", + "version": "9.5.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "89ff45ea9d70e35522fb6654a2ebc221158de276" + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/89ff45ea9d70e35522fb6654a2ebc221158de276", - "reference": "89ff45ea9d70e35522fb6654a2ebc221158de276", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/191768ccd5c85513b4068bdbe99bb6390c7d54fb", + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb", "shasum": "" }, "require": { @@ -5018,7 +5023,7 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", @@ -5036,7 +5041,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.2", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -5084,7 +5089,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.8" }, "funding": [ { @@ -5096,7 +5101,7 @@ "type": "github" } ], - "time": "2021-06-05T04:49:07+00:00" + "time": "2021-07-31T15:17:34+00:00" }, { "name": "psr/http-client", @@ -5656,16 +5661,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -5708,7 +5713,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -5716,7 +5721,7 @@ "type": "github" } ], - "time": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -6007,16 +6012,16 @@ }, { "name": "sebastian/type", - "version": "2.3.2", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0d1c587401514d17e8f9258a27e23527cb1b06c1", - "reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -6051,7 +6056,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.2" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -6059,7 +6064,7 @@ "type": "github" } ], - "time": "2021-06-04T13:02:07+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -6116,21 +6121,22 @@ }, { "name": "symfony/browser-kit", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "379984e25eee9811b0a25a2105e1a2b3b8d9b734" + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/379984e25eee9811b0a25a2105e1a2b3b8d9b734", - "reference": "379984e25eee9811b0a25a2105e1a2b3b8d9b734", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c1e3f64fcc631c96e2c5843b666db66679ced11c", + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/dom-crawler": "^4.4|^5.0" + "symfony/dom-crawler": "^4.4|^5.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "symfony/css-selector": "^4.4|^5.0", @@ -6167,7 +6173,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.3.0" + "source": "https://github.com/symfony/browser-kit/tree/v5.3.4" }, "funding": [ { @@ -6183,24 +6189,25 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/css-selector", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "fcd0b29a7a0b1bb5bfbedc6231583d77fea04814" + "reference": "7fb120adc7f600a59027775b224c13a33530dd90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/fcd0b29a7a0b1bb5bfbedc6231583d77fea04814", - "reference": "fcd0b29a7a0b1bb5bfbedc6231583d77fea04814", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/7fb120adc7f600a59027775b224c13a33530dd90", + "reference": "7fb120adc7f600a59027775b224c13a33530dd90", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6232,7 +6239,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.3.0" + "source": "https://github.com/symfony/css-selector/tree/v5.3.4" }, "funding": [ { @@ -6248,7 +6255,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:40:38+00:00" + "time": "2021-07-21T12:38:00+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6319,16 +6326,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "55fff62b19f413f897a752488ade1bc9c8a19cdd" + "reference": "2dd8890bd01be59a5221999c05ccf0fcafcb354f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/55fff62b19f413f897a752488ade1bc9c8a19cdd", - "reference": "55fff62b19f413f897a752488ade1bc9c8a19cdd", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2dd8890bd01be59a5221999c05ccf0fcafcb354f", + "reference": "2dd8890bd01be59a5221999c05ccf0fcafcb354f", "shasum": "" }, "require": { @@ -6336,7 +6343,7 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "masterminds/html5": "<2.6" @@ -6374,7 +6381,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.3.0" + "source": "https://github.com/symfony/dom-crawler/tree/v5.3.4" }, "funding": [ { @@ -6390,24 +6397,25 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-07-23T15:55:36+00:00" }, { "name": "symfony/finder", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6" + "reference": "17f50e06018baec41551a71a15731287dbaab186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", + "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", + "reference": "17f50e06018baec41551a71a15731287dbaab186", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6435,7 +6443,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.0" + "source": "https://github.com/symfony/finder/tree/v5.3.4" }, "funding": [ { @@ -6451,20 +6459,20 @@ "type": "tidelift" } ], - "time": "2021-05-26T12:52:38+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -6493,7 +6501,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -6501,7 +6509,7 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", diff --git a/system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php b/system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php index 197664a4f..dabfe17b7 100644 --- a/system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php +++ b/system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php @@ -120,7 +120,7 @@ trait FlexMediaTrait // Load settings for the field. $schema = $this->getBlueprint()->schema(); $settings = $field && is_object($schema) ? (array)$schema->getProperty($field) : null; - if (!isset($settings) || !is_array($settings)) { + if (!is_array($settings)) { return null; } From f45afd1f545b571c3580fb3db5905d6b4eb780c9 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 13 Aug 2021 13:05:32 +0300 Subject: [PATCH 25/35] Added support for multiple mime-types per file extension [#3422] --- CHANGELOG.md | 3 +- system/config/mime.yaml | 1986 +++++++++++++++++ .../Common/Media/Traits/MediaUploadTrait.php | 16 +- .../Common/Service/ConfigServiceProvider.php | 14 + system/src/Grav/Framework/Mime/MimeTypes.php | 107 + 5 files changed, 2120 insertions(+), 6 deletions(-) create mode 100644 system/config/mime.yaml create mode 100644 system/src/Grav/Framework/Mime/MimeTypes.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ab57d9166..15e841aab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ * Added `UserObject::$authorizeCallable` to allow `$user->authorize()` customization 1. [](#improved) * Added meta support for `UploadedFile` class - * Add `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) + * Added support for multiple mime-types per file extension [#3422](https://github.com/getgrav/grav/issues/3422) + * Added `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) * Initialize `$grav['uri]` before session 1. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) diff --git a/system/config/mime.yaml b/system/config/mime.yaml new file mode 100644 index 000000000..3143c6733 --- /dev/null +++ b/system/config/mime.yaml @@ -0,0 +1,1986 @@ +types: + '123': + - application/vnd.lotus-1-2-3 + wof: + - application/font-woff + php: + - application/php + - application/x-httpd-php + - application/x-httpd-php-source + - application/x-php + - text/php + - text/x-php + otf: + - application/x-font-otf + - font/otf + ttf: + - application/x-font-ttf + - font/ttf + ttc: + - application/x-font-ttf + - font/collection + zip: + - application/x-gzip + - application/zip + - application/x-zip-compressed + amr: + - audio/amr + mp3: + - audio/mpeg + mpga: + - audio/mpeg + mp2: + - audio/mpeg + mp2a: + - audio/mpeg + m2a: + - audio/mpeg + m3a: + - audio/mpeg + jpg: + - image/jpeg + jpeg: + - image/jpeg + jpe: + - image/jpeg + bmp: + - image/x-ms-bmp + - image/bmp + ez: + - application/andrew-inset + aw: + - application/applixware + atom: + - application/atom+xml + atomcat: + - application/atomcat+xml + atomsvc: + - application/atomsvc+xml + ccxml: + - application/ccxml+xml + cdmia: + - application/cdmi-capability + cdmic: + - application/cdmi-container + cdmid: + - application/cdmi-domain + cdmio: + - application/cdmi-object + cdmiq: + - application/cdmi-queue + cu: + - application/cu-seeme + davmount: + - application/davmount+xml + dbk: + - application/docbook+xml + dssc: + - application/dssc+der + xdssc: + - application/dssc+xml + ecma: + - application/ecmascript + emma: + - application/emma+xml + epub: + - application/epub+zip + exi: + - application/exi + pfr: + - application/font-tdpfr + gml: + - application/gml+xml + gpx: + - application/gpx+xml + gxf: + - application/gxf + stk: + - application/hyperstudio + ink: + - application/inkml+xml + inkml: + - application/inkml+xml + ipfix: + - application/ipfix + jar: + - application/java-archive + ser: + - application/java-serialized-object + class: + - application/java-vm + js: + - application/javascript + json: + - application/json + jsonml: + - application/jsonml+json + lostxml: + - application/lost+xml + hqx: + - application/mac-binhex40 + cpt: + - application/mac-compactpro + mads: + - application/mads+xml + mrc: + - application/marc + mrcx: + - application/marcxml+xml + ma: + - application/mathematica + nb: + - application/mathematica + mb: + - application/mathematica + mathml: + - application/mathml+xml + mbox: + - application/mbox + mscml: + - application/mediaservercontrol+xml + metalink: + - application/metalink+xml + meta4: + - application/metalink4+xml + mets: + - application/mets+xml + mods: + - application/mods+xml + m21: + - application/mp21 + mp21: + - application/mp21 + mp4s: + - application/mp4 + doc: + - application/msword + dot: + - application/msword + mxf: + - application/mxf + bin: + - application/octet-stream + dms: + - application/octet-stream + lrf: + - application/octet-stream + mar: + - application/octet-stream + so: + - application/octet-stream + dist: + - application/octet-stream + distz: + - application/octet-stream + pkg: + - application/octet-stream + bpk: + - application/octet-stream + dump: + - application/octet-stream + elc: + - application/octet-stream + deploy: + - application/octet-stream + oda: + - application/oda + opf: + - application/oebps-package+xml + ogx: + - application/ogg + omdoc: + - application/omdoc+xml + onetoc: + - application/onenote + onetoc2: + - application/onenote + onetmp: + - application/onenote + onepkg: + - application/onenote + oxps: + - application/oxps + xer: + - application/patch-ops-error+xml + pdf: + - application/pdf + pgp: + - application/pgp-encrypted + asc: + - application/pgp-signature + sig: + - application/pgp-signature + prf: + - application/pics-rules + p10: + - application/pkcs10 + p7m: + - application/pkcs7-mime + p7c: + - application/pkcs7-mime + p7s: + - application/pkcs7-signature + p8: + - application/pkcs8 + ac: + - application/pkix-attr-cert + cer: + - application/pkix-cert + crl: + - application/pkix-crl + pkipath: + - application/pkix-pkipath + pki: + - application/pkixcmp + pls: + - application/pls+xml + ai: + - application/postscript + eps: + - application/postscript + ps: + - application/postscript + cww: + - application/prs.cww + pskcxml: + - application/pskc+xml + rdf: + - application/rdf+xml + rif: + - application/reginfo+xml + rnc: + - application/relax-ng-compact-syntax + rl: + - application/resource-lists+xml + rld: + - application/resource-lists-diff+xml + rs: + - application/rls-services+xml + gbr: + - application/rpki-ghostbusters + mft: + - application/rpki-manifest + roa: + - application/rpki-roa + rsd: + - application/rsd+xml + rss: + - application/rss+xml + rtf: + - application/rtf + sbml: + - application/sbml+xml + scq: + - application/scvp-cv-request + scs: + - application/scvp-cv-response + spq: + - application/scvp-vp-request + spp: + - application/scvp-vp-response + sdp: + - application/sdp + setpay: + - application/set-payment-initiation + setreg: + - application/set-registration-initiation + shf: + - application/shf+xml + smi: + - application/smil+xml + smil: + - application/smil+xml + rq: + - application/sparql-query + srx: + - application/sparql-results+xml + gram: + - application/srgs + grxml: + - application/srgs+xml + sru: + - application/sru+xml + ssdl: + - application/ssdl+xml + ssml: + - application/ssml+xml + tei: + - application/tei+xml + teicorpus: + - application/tei+xml + tfi: + - application/thraud+xml + tsd: + - application/timestamped-data + plb: + - application/vnd.3gpp.pic-bw-large + psb: + - application/vnd.3gpp.pic-bw-small + pvb: + - application/vnd.3gpp.pic-bw-var + tcap: + - application/vnd.3gpp2.tcap + pwn: + - application/vnd.3m.post-it-notes + aso: + - application/vnd.accpac.simply.aso + imp: + - application/vnd.accpac.simply.imp + acu: + - application/vnd.acucobol + atc: + - application/vnd.acucorp + acutc: + - application/vnd.acucorp + air: + - application/vnd.adobe.air-application-installer-package+zip + fcdt: + - application/vnd.adobe.formscentral.fcdt + fxp: + - application/vnd.adobe.fxp + fxpl: + - application/vnd.adobe.fxp + xdp: + - application/vnd.adobe.xdp+xml + xfdf: + - application/vnd.adobe.xfdf + ahead: + - application/vnd.ahead.space + azf: + - application/vnd.airzip.filesecure.azf + azs: + - application/vnd.airzip.filesecure.azs + azw: + - application/vnd.amazon.ebook + acc: + - application/vnd.americandynamics.acc + ami: + - application/vnd.amiga.ami + apk: + - application/vnd.android.package-archive + cii: + - application/vnd.anser-web-certificate-issue-initiation + fti: + - application/vnd.anser-web-funds-transfer-initiation + atx: + - application/vnd.antix.game-component + mpkg: + - application/vnd.apple.installer+xml + m3u8: + - application/vnd.apple.mpegurl + swi: + - application/vnd.aristanetworks.swi + iota: + - application/vnd.astraea-software.iota + aep: + - application/vnd.audiograph + mpm: + - application/vnd.blueice.multipass + bmi: + - application/vnd.bmi + rep: + - application/vnd.businessobjects + cdxml: + - application/vnd.chemdraw+xml + mmd: + - application/vnd.chipnuts.karaoke-mmd + cdy: + - application/vnd.cinderella + cla: + - application/vnd.claymore + rp9: + - application/vnd.cloanto.rp9 + c4g: + - application/vnd.clonk.c4group + c4d: + - application/vnd.clonk.c4group + c4f: + - application/vnd.clonk.c4group + c4p: + - application/vnd.clonk.c4group + c4u: + - application/vnd.clonk.c4group + c11amc: + - application/vnd.cluetrust.cartomobile-config + c11amz: + - application/vnd.cluetrust.cartomobile-config-pkg + csp: + - application/vnd.commonspace + cdbcmsg: + - application/vnd.contact.cmsg + cmc: + - application/vnd.cosmocaller + clkx: + - application/vnd.crick.clicker + clkk: + - application/vnd.crick.clicker.keyboard + clkp: + - application/vnd.crick.clicker.palette + clkt: + - application/vnd.crick.clicker.template + clkw: + - application/vnd.crick.clicker.wordbank + wbs: + - application/vnd.criticaltools.wbs+xml + pml: + - application/vnd.ctc-posml + ppd: + - application/vnd.cups-ppd + car: + - application/vnd.curl.car + pcurl: + - application/vnd.curl.pcurl + dart: + - application/vnd.dart + rdz: + - application/vnd.data-vision.rdz + uvf: + - application/vnd.dece.data + uvvf: + - application/vnd.dece.data + uvd: + - application/vnd.dece.data + uvvd: + - application/vnd.dece.data + uvt: + - application/vnd.dece.ttml+xml + uvvt: + - application/vnd.dece.ttml+xml + uvx: + - application/vnd.dece.unspecified + uvvx: + - application/vnd.dece.unspecified + uvz: + - application/vnd.dece.zip + uvvz: + - application/vnd.dece.zip + fe_launch: + - application/vnd.denovo.fcselayout-link + dna: + - application/vnd.dna + mlp: + - application/vnd.dolby.mlp + dpg: + - application/vnd.dpgraph + dfac: + - application/vnd.dreamfactory + kpxx: + - application/vnd.ds-keypoint + ait: + - application/vnd.dvb.ait + svc: + - application/vnd.dvb.service + geo: + - application/vnd.dynageo + mag: + - application/vnd.ecowin.chart + nml: + - application/vnd.enliven + esf: + - application/vnd.epson.esf + msf: + - application/vnd.epson.msf + qam: + - application/vnd.epson.quickanime + slt: + - application/vnd.epson.salt + ssf: + - application/vnd.epson.ssf + es3: + - application/vnd.eszigno3+xml + et3: + - application/vnd.eszigno3+xml + ez2: + - application/vnd.ezpix-album + ez3: + - application/vnd.ezpix-package + fdf: + - application/vnd.fdf + mseed: + - application/vnd.fdsn.mseed + seed: + - application/vnd.fdsn.seed + dataless: + - application/vnd.fdsn.seed + gph: + - application/vnd.flographit + ftc: + - application/vnd.fluxtime.clip + fm: + - application/vnd.framemaker + frame: + - application/vnd.framemaker + maker: + - application/vnd.framemaker + book: + - application/vnd.framemaker + fnc: + - application/vnd.frogans.fnc + ltf: + - application/vnd.frogans.ltf + fsc: + - application/vnd.fsc.weblaunch + oas: + - application/vnd.fujitsu.oasys + oa2: + - application/vnd.fujitsu.oasys2 + oa3: + - application/vnd.fujitsu.oasys3 + fg5: + - application/vnd.fujitsu.oasysgp + bh2: + - application/vnd.fujitsu.oasysprs + ddd: + - application/vnd.fujixerox.ddd + xdw: + - application/vnd.fujixerox.docuworks + xbd: + - application/vnd.fujixerox.docuworks.binder + fzs: + - application/vnd.fuzzysheet + txd: + - application/vnd.genomatix.tuxedo + ggb: + - application/vnd.geogebra.file + ggt: + - application/vnd.geogebra.tool + gex: + - application/vnd.geometry-explorer + gre: + - application/vnd.geometry-explorer + gxt: + - application/vnd.geonext + g2w: + - application/vnd.geoplan + g3w: + - application/vnd.geospace + gmx: + - application/vnd.gmx + kml: + - application/vnd.google-earth.kml+xml + kmz: + - application/vnd.google-earth.kmz + gqf: + - application/vnd.grafeq + gqs: + - application/vnd.grafeq + gac: + - application/vnd.groove-account + ghf: + - application/vnd.groove-help + gim: + - application/vnd.groove-identity-message + grv: + - application/vnd.groove-injector + gtm: + - application/vnd.groove-tool-message + tpl: + - application/vnd.groove-tool-template + vcg: + - application/vnd.groove-vcard + hal: + - application/vnd.hal+xml + zmm: + - application/vnd.handheld-entertainment+xml + hbci: + - application/vnd.hbci + les: + - application/vnd.hhe.lesson-player + hpgl: + - application/vnd.hp-hpgl + hpid: + - application/vnd.hp-hpid + hps: + - application/vnd.hp-hps + jlt: + - application/vnd.hp-jlyt + pcl: + - application/vnd.hp-pcl + pclxl: + - application/vnd.hp-pclxl + sfd-hdstx: + - application/vnd.hydrostatix.sof-data + mpy: + - application/vnd.ibm.minipay + afp: + - application/vnd.ibm.modcap + listafp: + - application/vnd.ibm.modcap + list3820: + - application/vnd.ibm.modcap + irm: + - application/vnd.ibm.rights-management + sc: + - application/vnd.ibm.secure-container + icc: + - application/vnd.iccprofile + icm: + - application/vnd.iccprofile + igl: + - application/vnd.igloader + ivp: + - application/vnd.immervision-ivp + ivu: + - application/vnd.immervision-ivu + igm: + - application/vnd.insors.igm + xpw: + - application/vnd.intercon.formnet + xpx: + - application/vnd.intercon.formnet + i2g: + - application/vnd.intergeo + qbo: + - application/vnd.intu.qbo + qfx: + - application/vnd.intu.qfx + rcprofile: + - application/vnd.ipunplugged.rcprofile + irp: + - application/vnd.irepository.package+xml + xpr: + - application/vnd.is-xpr + fcs: + - application/vnd.isac.fcs + jam: + - application/vnd.jam + rms: + - application/vnd.jcp.javame.midlet-rms + jisp: + - application/vnd.jisp + joda: + - application/vnd.joost.joda-archive + ktz: + - application/vnd.kahootz + ktr: + - application/vnd.kahootz + karbon: + - application/vnd.kde.karbon + chrt: + - application/vnd.kde.kchart + kfo: + - application/vnd.kde.kformula + flw: + - application/vnd.kde.kivio + kon: + - application/vnd.kde.kontour + kpr: + - application/vnd.kde.kpresenter + kpt: + - application/vnd.kde.kpresenter + ksp: + - application/vnd.kde.kspread + kwd: + - application/vnd.kde.kword + kwt: + - application/vnd.kde.kword + htke: + - application/vnd.kenameaapp + kia: + - application/vnd.kidspiration + kne: + - application/vnd.kinar + knp: + - application/vnd.kinar + skp: + - application/vnd.koan + skd: + - application/vnd.koan + skt: + - application/vnd.koan + skm: + - application/vnd.koan + sse: + - application/vnd.kodak-descriptor + lasxml: + - application/vnd.las.las+xml + lbd: + - application/vnd.llamagraphics.life-balance.desktop + lbe: + - application/vnd.llamagraphics.life-balance.exchange+xml + apr: + - application/vnd.lotus-approach + pre: + - application/vnd.lotus-freelance + nsf: + - application/vnd.lotus-notes + org: + - application/vnd.lotus-organizer + scm: + - application/vnd.lotus-screencam + lwp: + - application/vnd.lotus-wordpro + portpkg: + - application/vnd.macports.portpkg + mcd: + - application/vnd.mcd + mc1: + - application/vnd.medcalcdata + cdkey: + - application/vnd.mediastation.cdkey + mwf: + - application/vnd.mfer + mfm: + - application/vnd.mfmp + flo: + - application/vnd.micrografx.flo + igx: + - application/vnd.micrografx.igx + mif: + - application/vnd.mif + daf: + - application/vnd.mobius.daf + dis: + - application/vnd.mobius.dis + mbk: + - application/vnd.mobius.mbk + mqy: + - application/vnd.mobius.mqy + msl: + - application/vnd.mobius.msl + plc: + - application/vnd.mobius.plc + txf: + - application/vnd.mobius.txf + mpn: + - application/vnd.mophun.application + mpc: + - application/vnd.mophun.certificate + xul: + - application/vnd.mozilla.xul+xml + cil: + - application/vnd.ms-artgalry + cab: + - application/vnd.ms-cab-compressed + xls: + - application/vnd.ms-excel + xlm: + - application/vnd.ms-excel + xla: + - application/vnd.ms-excel + xlc: + - application/vnd.ms-excel + xlt: + - application/vnd.ms-excel + xlw: + - application/vnd.ms-excel + xlam: + - application/vnd.ms-excel.addin.macroenabled.12 + xlsb: + - application/vnd.ms-excel.sheet.binary.macroenabled.12 + xlsm: + - application/vnd.ms-excel.sheet.macroenabled.12 + xltm: + - application/vnd.ms-excel.template.macroenabled.12 + eot: + - application/vnd.ms-fontobject + chm: + - application/vnd.ms-htmlhelp + ims: + - application/vnd.ms-ims + lrm: + - application/vnd.ms-lrm + thmx: + - application/vnd.ms-officetheme + cat: + - application/vnd.ms-pki.seccat + stl: + - application/vnd.ms-pki.stl + ppt: + - application/vnd.ms-powerpoint + pps: + - application/vnd.ms-powerpoint + pot: + - application/vnd.ms-powerpoint + ppam: + - application/vnd.ms-powerpoint.addin.macroenabled.12 + pptm: + - application/vnd.ms-powerpoint.presentation.macroenabled.12 + sldm: + - application/vnd.ms-powerpoint.slide.macroenabled.12 + ppsm: + - application/vnd.ms-powerpoint.slideshow.macroenabled.12 + potm: + - application/vnd.ms-powerpoint.template.macroenabled.12 + mpp: + - application/vnd.ms-project + mpt: + - application/vnd.ms-project + docm: + - application/vnd.ms-word.document.macroenabled.12 + dotm: + - application/vnd.ms-word.template.macroenabled.12 + wps: + - application/vnd.ms-works + wks: + - application/vnd.ms-works + wcm: + - application/vnd.ms-works + wdb: + - application/vnd.ms-works + wpl: + - application/vnd.ms-wpl + xps: + - application/vnd.ms-xpsdocument + mseq: + - application/vnd.mseq + mus: + - application/vnd.musician + msty: + - application/vnd.muvee.style + taglet: + - application/vnd.mynfc + nlu: + - application/vnd.neurolanguage.nlu + ntf: + - application/vnd.nitf + nitf: + - application/vnd.nitf + nnd: + - application/vnd.noblenet-directory + nns: + - application/vnd.noblenet-sealer + nnw: + - application/vnd.noblenet-web + ngdat: + - application/vnd.nokia.n-gage.data + n-gage: + - application/vnd.nokia.n-gage.symbian.install + rpst: + - application/vnd.nokia.radio-preset + rpss: + - application/vnd.nokia.radio-presets + edm: + - application/vnd.novadigm.edm + edx: + - application/vnd.novadigm.edx + ext: + - application/vnd.novadigm.ext + odc: + - application/vnd.oasis.opendocument.chart + otc: + - application/vnd.oasis.opendocument.chart-template + odb: + - application/vnd.oasis.opendocument.database + odf: + - application/vnd.oasis.opendocument.formula + odft: + - application/vnd.oasis.opendocument.formula-template + odg: + - application/vnd.oasis.opendocument.graphics + otg: + - application/vnd.oasis.opendocument.graphics-template + odi: + - application/vnd.oasis.opendocument.image + oti: + - application/vnd.oasis.opendocument.image-template + odp: + - application/vnd.oasis.opendocument.presentation + otp: + - application/vnd.oasis.opendocument.presentation-template + ods: + - application/vnd.oasis.opendocument.spreadsheet + ots: + - application/vnd.oasis.opendocument.spreadsheet-template + odt: + - application/vnd.oasis.opendocument.text + odm: + - application/vnd.oasis.opendocument.text-master + ott: + - application/vnd.oasis.opendocument.text-template + oth: + - application/vnd.oasis.opendocument.text-web + xo: + - application/vnd.olpc-sugar + dd2: + - application/vnd.oma.dd2+xml + oxt: + - application/vnd.openofficeorg.extension + pptx: + - application/vnd.openxmlformats-officedocument.presentationml.presentation + sldx: + - application/vnd.openxmlformats-officedocument.presentationml.slide + ppsx: + - application/vnd.openxmlformats-officedocument.presentationml.slideshow + potx: + - application/vnd.openxmlformats-officedocument.presentationml.template + xlsx: + - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + xltx: + - application/vnd.openxmlformats-officedocument.spreadsheetml.template + docx: + - application/vnd.openxmlformats-officedocument.wordprocessingml.document + dotx: + - application/vnd.openxmlformats-officedocument.wordprocessingml.template + mgp: + - application/vnd.osgeo.mapguide.package + dp: + - application/vnd.osgi.dp + esa: + - application/vnd.osgi.subsystem + pdb: + - application/vnd.palm + pqa: + - application/vnd.palm + oprc: + - application/vnd.palm + paw: + - application/vnd.pawaafile + str: + - application/vnd.pg.format + ei6: + - application/vnd.pg.osasli + efif: + - application/vnd.picsel + wg: + - application/vnd.pmi.widget + plf: + - application/vnd.pocketlearn + pbd: + - application/vnd.powerbuilder6 + box: + - application/vnd.previewsystems.box + mgz: + - application/vnd.proteus.magazine + qps: + - application/vnd.publishare-delta-tree + ptid: + - application/vnd.pvi.ptid1 + qxd: + - application/vnd.quark.quarkxpress + qxt: + - application/vnd.quark.quarkxpress + qwd: + - application/vnd.quark.quarkxpress + qwt: + - application/vnd.quark.quarkxpress + qxl: + - application/vnd.quark.quarkxpress + qxb: + - application/vnd.quark.quarkxpress + bed: + - application/vnd.realvnc.bed + mxl: + - application/vnd.recordare.musicxml + musicxml: + - application/vnd.recordare.musicxml+xml + cryptonote: + - application/vnd.rig.cryptonote + cod: + - application/vnd.rim.cod + rm: + - application/vnd.rn-realmedia + rmvb: + - application/vnd.rn-realmedia-vbr + link66: + - application/vnd.route66.link66+xml + st: + - application/vnd.sailingtracker.track + see: + - application/vnd.seemail + sema: + - application/vnd.sema + semd: + - application/vnd.semd + semf: + - application/vnd.semf + ifm: + - application/vnd.shana.informed.formdata + itp: + - application/vnd.shana.informed.formtemplate + iif: + - application/vnd.shana.informed.interchange + ipk: + - application/vnd.shana.informed.package + twd: + - application/vnd.simtech-mindmapper + twds: + - application/vnd.simtech-mindmapper + mmf: + - application/vnd.smaf + teacher: + - application/vnd.smart.teacher + sdkm: + - application/vnd.solent.sdkm+xml + sdkd: + - application/vnd.solent.sdkm+xml + dxp: + - application/vnd.spotfire.dxp + sfs: + - application/vnd.spotfire.sfs + sdc: + - application/vnd.stardivision.calc + sda: + - application/vnd.stardivision.draw + sdd: + - application/vnd.stardivision.impress + smf: + - application/vnd.stardivision.math + sdw: + - application/vnd.stardivision.writer + vor: + - application/vnd.stardivision.writer + sgl: + - application/vnd.stardivision.writer-global + smzip: + - application/vnd.stepmania.package + sm: + - application/vnd.stepmania.stepchart + sxc: + - application/vnd.sun.xml.calc + stc: + - application/vnd.sun.xml.calc.template + sxd: + - application/vnd.sun.xml.draw + std: + - application/vnd.sun.xml.draw.template + sxi: + - application/vnd.sun.xml.impress + sti: + - application/vnd.sun.xml.impress.template + sxm: + - application/vnd.sun.xml.math + sxw: + - application/vnd.sun.xml.writer + sxg: + - application/vnd.sun.xml.writer.global + stw: + - application/vnd.sun.xml.writer.template + sus: + - application/vnd.sus-calendar + susp: + - application/vnd.sus-calendar + svd: + - application/vnd.svd + sis: + - application/vnd.symbian.install + sisx: + - application/vnd.symbian.install + xsm: + - application/vnd.syncml+xml + bdm: + - application/vnd.syncml.dm+wbxml + xdm: + - application/vnd.syncml.dm+xml + tao: + - application/vnd.tao.intent-module-archive + pcap: + - application/vnd.tcpdump.pcap + cap: + - application/vnd.tcpdump.pcap + dmp: + - application/vnd.tcpdump.pcap + tmo: + - application/vnd.tmobile-livetv + tpt: + - application/vnd.trid.tpt + mxs: + - application/vnd.triscape.mxs + tra: + - application/vnd.trueapp + ufd: + - application/vnd.ufdl + ufdl: + - application/vnd.ufdl + utz: + - application/vnd.uiq.theme + umj: + - application/vnd.umajin + unityweb: + - application/vnd.unity + uoml: + - application/vnd.uoml+xml + vcx: + - application/vnd.vcx + vsd: + - application/vnd.visio + vst: + - application/vnd.visio + vss: + - application/vnd.visio + vsw: + - application/vnd.visio + vis: + - application/vnd.visionary + vsf: + - application/vnd.vsf + wbxml: + - application/vnd.wap.wbxml + wmlc: + - application/vnd.wap.wmlc + wmlsc: + - application/vnd.wap.wmlscriptc + wtb: + - application/vnd.webturbo + nbp: + - application/vnd.wolfram.player + wpd: + - application/vnd.wordperfect + wqd: + - application/vnd.wqd + stf: + - application/vnd.wt.stf + xar: + - application/vnd.xara + xfdl: + - application/vnd.xfdl + hvd: + - application/vnd.yamaha.hv-dic + hvs: + - application/vnd.yamaha.hv-script + hvp: + - application/vnd.yamaha.hv-voice + osf: + - application/vnd.yamaha.openscoreformat + osfpvg: + - application/vnd.yamaha.openscoreformat.osfpvg+xml + saf: + - application/vnd.yamaha.smaf-audio + spf: + - application/vnd.yamaha.smaf-phrase + cmp: + - application/vnd.yellowriver-custom-menu + zir: + - application/vnd.zul + zirz: + - application/vnd.zul + zaz: + - application/vnd.zzazz.deck+xml + vxml: + - application/voicexml+xml + wgt: + - application/widget + hlp: + - application/winhlp + wsdl: + - application/wsdl+xml + wspolicy: + - application/wspolicy+xml + 7z: + - application/x-7z-compressed + abw: + - application/x-abiword + ace: + - application/x-ace-compressed + dmg: + - application/x-apple-diskimage + aab: + - application/x-authorware-bin + x32: + - application/x-authorware-bin + u32: + - application/x-authorware-bin + vox: + - application/x-authorware-bin + aam: + - application/x-authorware-map + aas: + - application/x-authorware-seg + bcpio: + - application/x-bcpio + torrent: + - application/x-bittorrent + blb: + - application/x-blorb + blorb: + - application/x-blorb + bz: + - application/x-bzip + bz2: + - application/x-bzip2 + boz: + - application/x-bzip2 + cbr: + - application/x-cbr + cba: + - application/x-cbr + cbt: + - application/x-cbr + cbz: + - application/x-cbr + cb7: + - application/x-cbr + vcd: + - application/x-cdlink + cfs: + - application/x-cfs-compressed + chat: + - application/x-chat + pgn: + - application/x-chess-pgn + nsc: + - application/x-conference + cpio: + - application/x-cpio + csh: + - application/x-csh + deb: + - application/x-debian-package + udeb: + - application/x-debian-package + dgc: + - application/x-dgc-compressed + dir: + - application/x-director + dcr: + - application/x-director + dxr: + - application/x-director + cst: + - application/x-director + cct: + - application/x-director + cxt: + - application/x-director + w3d: + - application/x-director + fgd: + - application/x-director + swa: + - application/x-director + wad: + - application/x-doom + ncx: + - application/x-dtbncx+xml + dtb: + - application/x-dtbook+xml + res: + - application/x-dtbresource+xml + dvi: + - application/x-dvi + evy: + - application/x-envoy + eva: + - application/x-eva + bdf: + - application/x-font-bdf + gsf: + - application/x-font-ghostscript + psf: + - application/x-font-linux-psf + pcf: + - application/x-font-pcf + snf: + - application/x-font-snf + pfa: + - application/x-font-type1 + pfb: + - application/x-font-type1 + pfm: + - application/x-font-type1 + afm: + - application/x-font-type1 + arc: + - application/x-freearc + spl: + - application/x-futuresplash + gca: + - application/x-gca-compressed + ulx: + - application/x-glulx + gnumeric: + - application/x-gnumeric + gramps: + - application/x-gramps-xml + gtar: + - application/x-gtar + hdf: + - application/x-hdf + install: + - application/x-install-instructions + iso: + - application/x-iso9660-image + jnlp: + - application/x-java-jnlp-file + latex: + - application/x-latex + lzh: + - application/x-lzh-compressed + lha: + - application/x-lzh-compressed + mie: + - application/x-mie + prc: + - application/x-mobipocket-ebook + mobi: + - application/x-mobipocket-ebook + application: + - application/x-ms-application + lnk: + - application/x-ms-shortcut + wmd: + - application/x-ms-wmd + wmz: + - application/x-ms-wmz + - application/x-msmetafile + xbap: + - application/x-ms-xbap + mdb: + - application/x-msaccess + obd: + - application/x-msbinder + crd: + - application/x-mscardfile + clp: + - application/x-msclip + exe: + - application/x-msdownload + dll: + - application/x-msdownload + com: + - application/x-msdownload + bat: + - application/x-msdownload + msi: + - application/x-msdownload + mvb: + - application/x-msmediaview + m13: + - application/x-msmediaview + m14: + - application/x-msmediaview + wmf: + - application/x-msmetafile + emf: + - application/x-msmetafile + emz: + - application/x-msmetafile + mny: + - application/x-msmoney + pub: + - application/x-mspublisher + scd: + - application/x-msschedule + trm: + - application/x-msterminal + wri: + - application/x-mswrite + nc: + - application/x-netcdf + cdf: + - application/x-netcdf + nzb: + - application/x-nzb + p12: + - application/x-pkcs12 + pfx: + - application/x-pkcs12 + p7b: + - application/x-pkcs7-certificates + spc: + - application/x-pkcs7-certificates + p7r: + - application/x-pkcs7-certreqresp + rar: + - application/x-rar-compressed + ris: + - application/x-research-info-systems + sh: + - application/x-sh + shar: + - application/x-shar + swf: + - application/x-shockwave-flash + xap: + - application/x-silverlight-app + sql: + - application/x-sql + sit: + - application/x-stuffit + sitx: + - application/x-stuffitx + srt: + - application/x-subrip + sv4cpio: + - application/x-sv4cpio + sv4crc: + - application/x-sv4crc + t3: + - application/x-t3vm-image + gam: + - application/x-tads + tar: + - application/x-tar + tcl: + - application/x-tcl + tex: + - application/x-tex + tfm: + - application/x-tex-tfm + texinfo: + - application/x-texinfo + texi: + - application/x-texinfo + obj: + - application/x-tgif + ustar: + - application/x-ustar + src: + - application/x-wais-source + der: + - application/x-x509-ca-cert + crt: + - application/x-x509-ca-cert + fig: + - application/x-xfig + xlf: + - application/x-xliff+xml + xpi: + - application/x-xpinstall + xz: + - application/x-xz + z1: + - application/x-zmachine + z2: + - application/x-zmachine + z3: + - application/x-zmachine + z4: + - application/x-zmachine + z5: + - application/x-zmachine + z6: + - application/x-zmachine + z7: + - application/x-zmachine + z8: + - application/x-zmachine + xaml: + - application/xaml+xml + xdf: + - application/xcap-diff+xml + xenc: + - application/xenc+xml + xhtml: + - application/xhtml+xml + xht: + - application/xhtml+xml + xml: + - application/xml + xsl: + - application/xml + dtd: + - application/xml-dtd + xop: + - application/xop+xml + xpl: + - application/xproc+xml + xslt: + - application/xslt+xml + xspf: + - application/xspf+xml + mxml: + - application/xv+xml + xhvml: + - application/xv+xml + xvml: + - application/xv+xml + xvm: + - application/xv+xml + yang: + - application/yang + yin: + - application/yin+xml + adp: + - audio/adpcm + au: + - audio/basic + snd: + - audio/basic + mid: + - audio/midi + midi: + - audio/midi + kar: + - audio/midi + rmi: + - audio/midi + m4a: + - audio/mp4 + mp4a: + - audio/mp4 + oga: + - audio/ogg + ogg: + - audio/ogg + spx: + - audio/ogg + s3m: + - audio/s3m + sil: + - audio/silk + uva: + - audio/vnd.dece.audio + uvva: + - audio/vnd.dece.audio + eol: + - audio/vnd.digital-winds + dra: + - audio/vnd.dra + dts: + - audio/vnd.dts + dtshd: + - audio/vnd.dts.hd + lvp: + - audio/vnd.lucent.voice + pya: + - audio/vnd.ms-playready.media.pya + ecelp4800: + - audio/vnd.nuera.ecelp4800 + ecelp7470: + - audio/vnd.nuera.ecelp7470 + ecelp9600: + - audio/vnd.nuera.ecelp9600 + rip: + - audio/vnd.rip + weba: + - audio/webm + aac: + - audio/x-aac + aif: + - audio/x-aiff + aiff: + - audio/x-aiff + aifc: + - audio/x-aiff + caf: + - audio/x-caf + flac: + - audio/x-flac + mka: + - audio/x-matroska + m3u: + - audio/x-mpegurl + wax: + - audio/x-ms-wax + wma: + - audio/x-ms-wma + ram: + - audio/x-pn-realaudio + ra: + - audio/x-pn-realaudio + rmp: + - audio/x-pn-realaudio-plugin + wav: + - audio/x-wav + xm: + - audio/xm + cdx: + - chemical/x-cdx + cif: + - chemical/x-cif + cmdf: + - chemical/x-cmdf + cml: + - chemical/x-cml + csml: + - chemical/x-csml + xyz: + - chemical/x-xyz + woff: + - font/woff + woff2: + - font/woff2 + cgm: + - image/cgm + g3: + - image/g3fax + gif: + - image/gif + ief: + - image/ief + ktx: + - image/ktx + png: + - image/png + btif: + - image/prs.btif + sgi: + - image/sgi + svg: + - image/svg+xml + svgz: + - image/svg+xml + tiff: + - image/tiff + tif: + - image/tiff + psd: + - image/vnd.adobe.photoshop + uvi: + - image/vnd.dece.graphic + uvvi: + - image/vnd.dece.graphic + uvg: + - image/vnd.dece.graphic + uvvg: + - image/vnd.dece.graphic + djvu: + - image/vnd.djvu + djv: + - image/vnd.djvu + sub: + - image/vnd.dvb.subtitle + - text/vnd.dvb.subtitle + dwg: + - image/vnd.dwg + dxf: + - image/vnd.dxf + fbs: + - image/vnd.fastbidsheet + fpx: + - image/vnd.fpx + fst: + - image/vnd.fst + mmr: + - image/vnd.fujixerox.edmics-mmr + rlc: + - image/vnd.fujixerox.edmics-rlc + mdi: + - image/vnd.ms-modi + wdp: + - image/vnd.ms-photo + npx: + - image/vnd.net-fpx + wbmp: + - image/vnd.wap.wbmp + xif: + - image/vnd.xiff + webp: + - image/webp + 3ds: + - image/x-3ds + ras: + - image/x-cmu-raster + cmx: + - image/x-cmx + fh: + - image/x-freehand + fhc: + - image/x-freehand + fh4: + - image/x-freehand + fh5: + - image/x-freehand + fh7: + - image/x-freehand + ico: + - image/x-icon + sid: + - image/x-mrsid-image + pcx: + - image/x-pcx + pic: + - image/x-pict + pct: + - image/x-pict + pnm: + - image/x-portable-anymap + pbm: + - image/x-portable-bitmap + pgm: + - image/x-portable-graymap + ppm: + - image/x-portable-pixmap + rgb: + - image/x-rgb + tga: + - image/x-tga + xbm: + - image/x-xbitmap + xpm: + - image/x-xpixmap + xwd: + - image/x-xwindowdump + eml: + - message/rfc822 + mime: + - message/rfc822 + igs: + - model/iges + iges: + - model/iges + msh: + - model/mesh + mesh: + - model/mesh + silo: + - model/mesh + dae: + - model/vnd.collada+xml + dwf: + - model/vnd.dwf + gdl: + - model/vnd.gdl + gtw: + - model/vnd.gtw + mts: + - model/vnd.mts + vtu: + - model/vnd.vtu + wrl: + - model/vrml + vrml: + - model/vrml + x3db: + - model/x3d+binary + x3dbz: + - model/x3d+binary + x3dv: + - model/x3d+vrml + x3dvz: + - model/x3d+vrml + x3d: + - model/x3d+xml + x3dz: + - model/x3d+xml + appcache: + - text/cache-manifest + ics: + - text/calendar + ifb: + - text/calendar + css: + - text/css + csv: + - text/csv + html: + - text/html + htm: + - text/html + n3: + - text/n3 + txt: + - text/plain + text: + - text/plain + conf: + - text/plain + def: + - text/plain + list: + - text/plain + log: + - text/plain + in: + - text/plain + dsc: + - text/prs.lines.tag + rtx: + - text/richtext + sgml: + - text/sgml + sgm: + - text/sgml + tsv: + - text/tab-separated-values + t: + - text/troff + tr: + - text/troff + roff: + - text/troff + man: + - text/troff + me: + - text/troff + ms: + - text/troff + ttl: + - text/turtle + uri: + - text/uri-list + uris: + - text/uri-list + urls: + - text/uri-list + vcard: + - text/vcard + curl: + - text/vnd.curl + dcurl: + - text/vnd.curl.dcurl + mcurl: + - text/vnd.curl.mcurl + scurl: + - text/vnd.curl.scurl + fly: + - text/vnd.fly + flx: + - text/vnd.fmi.flexstor + gv: + - text/vnd.graphviz + 3dml: + - text/vnd.in3d.3dml + spot: + - text/vnd.in3d.spot + jad: + - text/vnd.sun.j2me.app-descriptor + wml: + - text/vnd.wap.wml + wmls: + - text/vnd.wap.wmlscript + s: + - text/x-asm + asm: + - text/x-asm + c: + - text/x-c + cc: + - text/x-c + cxx: + - text/x-c + cpp: + - text/x-c + h: + - text/x-c + hh: + - text/x-c + dic: + - text/x-c + f: + - text/x-fortran + for: + - text/x-fortran + f77: + - text/x-fortran + f90: + - text/x-fortran + java: + - text/x-java-source + nfo: + - text/x-nfo + opml: + - text/x-opml + p: + - text/x-pascal + pas: + - text/x-pascal + etx: + - text/x-setext + sfv: + - text/x-sfv + uu: + - text/x-uuencode + vcs: + - text/x-vcalendar + vcf: + - text/x-vcard + 3gp: + - video/3gpp + 3g2: + - video/3gpp2 + h261: + - video/h261 + h263: + - video/h263 + h264: + - video/h264 + jpgv: + - video/jpeg + jpm: + - video/jpm + jpgm: + - video/jpm + mj2: + - video/mj2 + mjp2: + - video/mj2 + mp4: + - video/mp4 + mp4v: + - video/mp4 + mpg4: + - video/mp4 + mpeg: + - video/mpeg + mpg: + - video/mpeg + mpe: + - video/mpeg + m1v: + - video/mpeg + m2v: + - video/mpeg + ogv: + - video/ogg + qt: + - video/quicktime + mov: + - video/quicktime + uvh: + - video/vnd.dece.hd + uvvh: + - video/vnd.dece.hd + uvm: + - video/vnd.dece.mobile + uvvm: + - video/vnd.dece.mobile + uvp: + - video/vnd.dece.pd + uvvp: + - video/vnd.dece.pd + uvs: + - video/vnd.dece.sd + uvvs: + - video/vnd.dece.sd + uvv: + - video/vnd.dece.video + uvvv: + - video/vnd.dece.video + dvb: + - video/vnd.dvb.file + fvt: + - video/vnd.fvt + mxu: + - video/vnd.mpegurl + m4u: + - video/vnd.mpegurl + pyv: + - video/vnd.ms-playready.media.pyv + uvu: + - video/vnd.uvvu.mp4 + uvvu: + - video/vnd.uvvu.mp4 + viv: + - video/vnd.vivo + webm: + - video/webm + f4v: + - video/x-f4v + fli: + - video/x-fli + flv: + - video/x-flv + m4v: + - video/x-m4v + mkv: + - video/x-matroska + mk3d: + - video/x-matroska + mks: + - video/x-matroska + mng: + - video/x-mng + asf: + - video/x-ms-asf + asx: + - video/x-ms-asf + vob: + - video/x-ms-vob + wm: + - video/x-ms-wm + wmv: + - video/x-ms-wmv + wmx: + - video/x-ms-wmx + wvx: + - video/x-ms-wvx + avi: + - video/x-msvideo + movie: + - video/x-sgi-movie + smv: + - video/x-smv + ice: + - x-conference/x-cooltalk diff --git a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php index fbbfe4170..71431ed57 100644 --- a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php +++ b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php @@ -20,11 +20,13 @@ use Grav\Common\Security; use Grav\Common\Utils; use Grav\Framework\Filesystem\Filesystem; use Grav\Framework\Form\FormFlashFile; +use Grav\Framework\Mime\MimeTypes; use Psr\Http\Message\UploadedFileInterface; use RocketTheme\Toolbox\File\YamlFile; use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator; use RuntimeException; use function dirname; +use function in_array; /** * Implements media upload and delete functionality. @@ -179,16 +181,20 @@ trait MediaUploadTrait } } + $grav = Grav::instance(); + /** @var MimeTypes $mimeChecker */ + $mimeChecker = $grav['mime']; + // Handle Accepted file types. Accept can only be mime types (image/png | image/*) or file extensions (.pdf | .jpg) - $accepted = false; - $errors = []; // Do not trust mime type sent by the browser. - $mime = Utils::getMimeByFilename($filename); - $mimeTest = $metadata['mime'] ?? $mime; - if ($mime !== $mimeTest) { + $mime = $metadata['mime'] ?? $mimeChecker->getMimeType($extension); + $validExtensions = $mimeChecker->getExtensions($mime); + if (!in_array($extension, $validExtensions, true)) { throw new RuntimeException('The mime type does not match to file extension', 400); } + $accepted = false; + $errors = []; foreach ((array)$settings['accept'] as $type) { // Force acceptance of any file when star notation if ($type === '*') { diff --git a/system/src/Grav/Common/Service/ConfigServiceProvider.php b/system/src/Grav/Common/Service/ConfigServiceProvider.php index a423f6e1d..b56f62fde 100644 --- a/system/src/Grav/Common/Service/ConfigServiceProvider.php +++ b/system/src/Grav/Common/Service/ConfigServiceProvider.php @@ -17,6 +17,7 @@ use Grav\Common\Config\Config; use Grav\Common\Config\ConfigFileFinder; use Grav\Common\Config\Setup; use Grav\Common\Language\Language; +use Grav\Framework\Mime\MimeTypes; use Pimple\Container; use Pimple\ServiceProviderInterface; use RocketTheme\Toolbox\File\YamlFile; @@ -56,6 +57,19 @@ class ConfigServiceProvider implements ServiceProviderInterface return $config; }; + $container['mime'] = function ($c) { + /** @var Config $config */ + $config = $c['config']; + $mimes = $config->get('mime.types', []); + foreach ($config->get('media.types', []) as $ext => $media) { + if (!empty($media['mime'])) { + $mimes[$ext] = array_unique(array_merge([$media['mime']], $mimes[$ext] ?? [])); + } + } + + return MimeTypes::createFromMimes($mimes); + }; + $container['languages'] = function ($c) { return static::languages($c); }; diff --git a/system/src/Grav/Framework/Mime/MimeTypes.php b/system/src/Grav/Framework/Mime/MimeTypes.php new file mode 100644 index 000000000..dadcddf7a --- /dev/null +++ b/system/src/Grav/Framework/Mime/MimeTypes.php @@ -0,0 +1,107 @@ + ['mime/type', 'mime/type2']] + */ + public static function createFromMimes(array $mimes): self + { + $extensions = []; + foreach ($mimes as $ext => $list) { + foreach ($list as $mime) { + $list = $extensions[$mime] ?? []; + if (!in_array($ext, $list, true)) { + $list[] = $ext; + $extensions[$mime] = $list; + } + } + } + + return new static($extensions, $mimes); + } + + /** + * @param string $extension + * @return string|null + */ + public function getMimeType(string $extension): ?string + { + $extension = $this->cleanInput($extension); + + return $this->mimes[$extension][0] ?? null; + } + + /** + * @param string $mime + * @return string|null + */ + public function getExtension(string $mime): ?string + { + $mime = $this->cleanInput($mime); + + return $this->extensions[$mime][0] ?? null; + } + + /** + * @param string $extension + * @return array + */ + public function getMimeTypes(string $extension): array + { + $extension = $this->cleanInput($extension); + + return $this->mimes[$extension] ?? []; + } + + /** + * @param string $mime + * @return array + */ + public function getExtensions(string $mime): array + { + $mime = $this->cleanInput($mime); + + return $this->extensions[$mime] ?? []; + } + + /** + * @param string $input + * @return string + */ + protected function cleanInput(string $input): string + { + return strtolower(trim($input)); + } + + /** + * @param array $extensions + * @param array $mimes + */ + protected function __construct(array $extensions, array $mimes) + { + $this->extensions = $extensions; + $this->mimes = $mimes; + } +} From 21bd51aef9b37aafe06351a39f38957a80943342 Mon Sep 17 00:00:00 2001 From: Andy Miller <1084697+rhukster@users.noreply.github.com> Date: Fri, 13 Aug 2021 09:59:03 -0400 Subject: [PATCH 26/35] remove sensio --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 562349f91..31a4a7e4b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # ![](https://avatars1.githubusercontent.com/u/8237355?v=2&s=50) Grav [![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad/mini.png)](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad) [![Discord](https://img.shields.io/discord/501836936584101899.svg?logo=discord&colorB=728ADA&label=Discord%20Chat)](https://chat.getgrav.org) [![PHP Tests](https://github.com/getgrav/grav/workflows/PHP%20Tests/badge.svg?branch=develop)](https://github.com/getgrav/grav/actions?query=workflow%3A%22PHP+Tests%22) [![OpenCollective](https://opencollective.com/grav/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/grav/sponsors/badge.svg)](#sponsors) From 34d001cbef80fd5654627b55224097fec5631126 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Fri, 13 Aug 2021 16:58:35 +0200 Subject: [PATCH 27/35] fix typo mime type of `.aif` (#3423) mime type should be `audio/aiff` reference: https://en.wikipedia.org/wiki/Audio_Interchange_File_Format --- system/config/media.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/config/media.yaml b/system/config/media.yaml index 9c9918af2..1f1469f9d 100644 --- a/system/config/media.yaml +++ b/system/config/media.yaml @@ -91,7 +91,7 @@ types: aif: type: audio thumb: media/thumb-aif.png - mime: audio/aif + mime: audio/aiff txt: type: file thumb: media/thumb-txt.png From de3aa16aca694db9559c58fb8da67b692a39397f Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Fri, 13 Aug 2021 17:02:37 +0200 Subject: [PATCH 28/35] add mime for `.avif` image format new image format developed by google references: https://codelabs.developers.google.com/codelabs/avif#0 https://caniuse.com/avif --- system/config/media.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/config/media.yaml b/system/config/media.yaml index 1f1469f9d..b118a210e 100644 --- a/system/config/media.yaml +++ b/system/config/media.yaml @@ -28,6 +28,10 @@ types: type: image thumb: media/thumb-webp.png mime: image/webp + avif: + type: image + thumb: media/thumb.png + mime: image/avif gif: type: animated thumb: media/thumb-gif.png From 794237bf3091057dd7c5b6263ab4698e85d8bead Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Wed, 18 Aug 2021 09:31:09 -0700 Subject: [PATCH 29/35] Minor indentation config tweaks --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 8d06361b3..bb3487439 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,5 +13,5 @@ indent_size = 4 trim_trailing_whitespace = true # 2 space indentation -[*.{yaml,yml}] +[*.{yaml,yml,vue,js,css}] indent_size = 2 From aa47cb7b9799fa59183bbb46a12e17d131b1ea03 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 18 Aug 2021 14:04:21 -0600 Subject: [PATCH 30/35] ignore cli/security.yaml --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 26ca72dff..5f80bdaa1 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ tests/cache/* tests/error.log system/templates/testing/* /user/config/versions.yaml +/user/cli/config/security.yaml From 292687ea00ec54e2bbc5715c9f2e0b4344bc4a01 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 25 Aug 2021 18:31:58 +0300 Subject: [PATCH 31/35] Fixed wrong form issue with flex objects after cache clear --- CHANGELOG.md | 5 +++-- system/src/Grav/Framework/Flex/FlexObject.php | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e841aab..9e71f377a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,12 @@ 1. [](#new) * Include active form and request in `onPageTask` and `onPageAction` events (defaults to `null`) * Added `UserObject::$authorizeCallable` to allow `$user->authorize()` customization -1. [](#improved) +2. [](#improved) * Added meta support for `UploadedFile` class * Added support for multiple mime-types per file extension [#3422](https://github.com/getgrav/grav/issues/3422) * Added `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) * Initialize `$grav['uri]` before session -1. [](#bugfix) +3. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) * Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410) @@ -19,6 +19,7 @@ * Fixed `FlexForm` serialization * Fixed form validation for numeric values in PHP 8 * Fixed `flex-options@` in blueprints duplicating items in array + * Fixed wrong form issue with flex objects after cache clear # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Framework/Flex/FlexObject.php b/system/src/Grav/Framework/Flex/FlexObject.php index 97b2569b0..fb4e59f36 100644 --- a/system/src/Grav/Framework/Flex/FlexObject.php +++ b/system/src/Grav/Framework/Flex/FlexObject.php @@ -44,6 +44,7 @@ use function is_array; use function is_object; use function is_scalar; use function is_string; +use function json_encode; /** * Class FlexObject @@ -820,11 +821,12 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface */ public function getForm(string $name = '', array $options = null) { - if (!isset($this->_forms[$name])) { - $this->_forms[$name] = $this->createFormObject($name, $options); + $hash = $name . '-' . md5(json_encode($options, JSON_THROW_ON_ERROR)); + if (!isset($this->_forms[$hash])) { + $this->_forms[$hash] = $this->createFormObject($name, $options); } - return $this->_forms[$name]; + return $this->_forms[$hash]; } /** From 3f3f63f411ec4c1585b7e7df516b4ca15ac27173 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 25 Aug 2021 18:50:08 +0300 Subject: [PATCH 32/35] Fixed Flex object types not implementing `MediaInterface` --- CHANGELOG.md | 1 + system/src/Grav/Common/Flex/FlexObject.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e71f377a..71f28f179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * Fixed form validation for numeric values in PHP 8 * Fixed `flex-options@` in blueprints duplicating items in array * Fixed wrong form issue with flex objects after cache clear + * Fixed Flex object types not implementing `MediaInterface` # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/Flex/FlexObject.php b/system/src/Grav/Common/Flex/FlexObject.php index 2a43eaa44..66e5412aa 100644 --- a/system/src/Grav/Common/Flex/FlexObject.php +++ b/system/src/Grav/Common/Flex/FlexObject.php @@ -13,6 +13,7 @@ namespace Grav\Common\Flex; use Grav\Common\Flex\Traits\FlexGravTrait; use Grav\Common\Flex\Traits\FlexObjectTrait; +use Grav\Common\Media\Interfaces\MediaInterface; use Grav\Framework\Flex\Traits\FlexMediaTrait; use function is_array; @@ -21,7 +22,7 @@ use function is_array; * * @package Grav\Common\Flex */ -abstract class FlexObject extends \Grav\Framework\Flex\FlexObject +abstract class FlexObject extends \Grav\Framework\Flex\FlexObject implements MediaInterface { use FlexGravTrait; use FlexObjectTrait; From 8042caee570938296847d4e325a6314ef58c8826 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 27 Aug 2021 10:26:00 -0600 Subject: [PATCH 33/35] fixed svgImageFunction() --- CHANGELOG.md | 1 + system/src/Grav/Common/Twig/Extension/GravExtension.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f28f179..01211d896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * Fixed `flex-options@` in blueprints duplicating items in array * Fixed wrong form issue with flex objects after cache clear * Fixed Flex object types not implementing `MediaInterface` + * Fixed issue with `svgImageFunction()` that was causing broken output # v1.7.18 ## 07/19/2021 diff --git a/system/src/Grav/Common/Twig/Extension/GravExtension.php b/system/src/Grav/Common/Twig/Extension/GravExtension.php index 7774d2afb..2c6b85436 100644 --- a/system/src/Grav/Common/Twig/Extension/GravExtension.php +++ b/system/src/Grav/Common/Twig/Extension/GravExtension.php @@ -1499,7 +1499,7 @@ class GravExtension extends AbstractExtension implements GlobalsInterface } //Look for existing class - $svg = preg_replace_callback('/^]*(class=\")([^"]*)(\")[^>]*>/', function($matches) use ($classes, &$matched) { + $svg = preg_replace_callback('/^]*(class=\"([^"]*)\")[^>]*>/', function($matches) use ($classes, &$matched) { if (isset($matches[2])) { $new_classes = $matches[2] . $classes; $matched = true; From f9e7f1c08efa1adf694fd7ad56f9a782ccefdc13 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 30 Aug 2021 09:55:21 +0300 Subject: [PATCH 34/35] Flex: Use str_replace() and not strtr() --- CHANGELOG.md | 2 +- system/src/Grav/Framework/Flex/FlexDirectory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01211d896..4c0f367e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * Added meta support for `UploadedFile` class * Added support for multiple mime-types per file extension [#3422](https://github.com/getgrav/grav/issues/3422) * Added `setCurrent()` method to Page Collection [#3398](https://github.com/getgrav/grav/pull/3398) - * Initialize `$grav['uri]` before session + * Initialize `$grav['uri']` before session 3. [](#bugfix) * Fixed `Warning: Undefined array key "SERVER_SOFTWARE" in index.php` [#3408](https://github.com/getgrav/grav/issues/3408) * Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409) diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index 402c9746d..43fe00081 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -239,7 +239,7 @@ class FlexDirectory implements FlexDirectoryInterface // If configuration is found in main configuration, use it. if (str_starts_with($uri, 'config://')) { - $path = strtr(substr($uri, 9, -5), '/', '.'); + $path = str_replace('/', '.', substr($uri, 9, -5)); return (array)$grav['config']->get($path); } From fd8c44ba905f5fa745451fc1dba20026c49189fb Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 31 Aug 2021 12:21:31 -0600 Subject: [PATCH 35/35] prepare for release --- CHANGELOG.md | 2 +- system/defines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c0f367e0..98cc0f6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.19 -## mm/dd/2021 +## 08/31/2021 1. [](#new) * Include active form and request in `onPageTask` and `onPageAction` events (defaults to `null`) diff --git a/system/defines.php b/system/defines.php index 4cd520a60..7c6d79ea6 100644 --- a/system/defines.php +++ b/system/defines.php @@ -9,7 +9,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.18'); +define('GRAV_VERSION', '1.7.19'); define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false);