From 840441bc9bfc9c9dcd136b564091302fcec37b8c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 3 Feb 2022 19:50:02 +0200 Subject: [PATCH 01/11] Composer update --- composer.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/composer.lock b/composer.lock index ce9ff368c2..27632ac380 100644 --- a/composer.lock +++ b/composer.lock @@ -764,12 +764,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1316,16 +1316,16 @@ }, { "name": "nyholm/psr7", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec" + "reference": "1461e07a0f2a975a52082ca3b769ca912b816226" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/2212385b47153ea71b1c1b1374f8cb5e4f7892ec", - "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/1461e07a0f2a975a52082ca3b769ca912b816226", + "reference": "1461e07a0f2a975a52082ca3b769ca912b816226", "shasum": "" }, "require": { @@ -1377,7 +1377,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.4.1" + "source": "https://github.com/Nyholm/psr7/tree/1.5.0" }, "funding": [ { @@ -1389,7 +1389,7 @@ "type": "github" } ], - "time": "2021-07-02T08:32:20+00:00" + "time": "2022-02-02T18:37:57+00:00" }, { "name": "nyholm/psr7-server", @@ -4214,12 +4214,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4641,16 +4641,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.4.3", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "89d10839dbfc95eeb7da656578b4a899ad2b59b1" + "reference": "150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89d10839dbfc95eeb7da656578b4a899ad2b59b1", - "reference": "89d10839dbfc95eeb7da656578b4a899ad2b59b1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3", + "reference": "150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3", "shasum": "" }, "require": { @@ -4681,7 +4681,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.4.3" + "source": "https://github.com/phpstan/phpstan/tree/1.4.5" }, "funding": [ { @@ -4701,7 +4701,7 @@ "type": "tidelift" } ], - "time": "2022-01-28T16:27:17+00:00" + "time": "2022-02-02T19:35:10+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From c82a35cea034095fe5d339ce535de83f95a14716 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 3 Feb 2022 19:51:46 +0200 Subject: [PATCH 02/11] Added twig filter `|field_parent` to get parent field name --- CHANGELOG.md | 6 ++++++ .../Common/Twig/Extension/GravExtension.php | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b1de77f66..dffa83d765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.30 +## mm/dd/2022 + +3. [](#new) + * Added twig filter `|field_parent` to get parent field name + # v1.7.29.1 ## 01/31/2022 diff --git a/system/src/Grav/Common/Twig/Extension/GravExtension.php b/system/src/Grav/Common/Twig/Extension/GravExtension.php index dcff83750d..52e2a1841b 100644 --- a/system/src/Grav/Common/Twig/Extension/GravExtension.php +++ b/system/src/Grav/Common/Twig/Extension/GravExtension.php @@ -116,6 +116,7 @@ public function getFilters(): array new TwigFilter('defined', [$this, 'definedDefaultFilter']), new TwigFilter('ends_with', [$this, 'endsWithFilter']), new TwigFilter('fieldName', [$this, 'fieldNameFilter']), + new TwigFilter('parent_field', [$this, 'fieldParentFilter']), new TwigFilter('ksort', [$this, 'ksortFilter']), new TwigFilter('ltrim', [$this, 'ltrimFilter']), new TwigFilter('markdown', [$this, 'markdownFunction'], ['needs_context' => true, 'is_safe' => ['html']]), @@ -260,6 +261,10 @@ public function getTokenParsers(): array ]; } + /** + * @param mixed $var + * @return string + */ public function print_r($var) { return print_r($var, true); @@ -278,6 +283,20 @@ public function fieldNameFilter($str) return array_shift($path) . ($path ? '[' . implode('][', $path) . ']' : ''); } + /** + * Filters field name by changing dot notation into array notation. + * + * @param string $str + * @return string + */ + public function fieldParentFilter($str) + { + $path = explode('.', rtrim($str, '.')); + array_pop($path); + + return implode('.', $path); + } + /** * Protects email address. * From 67ef9b221aebba67f248b5eacf11162e16d14c2b Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 4 Feb 2022 19:58:23 +0200 Subject: [PATCH 03/11] Fixed error while deleting retina image in admin --- CHANGELOG.md | 6 ++++-- system/src/Grav/Common/Media/Traits/MediaUploadTrait.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dffa83d765..74df68fd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ # v1.7.30 ## mm/dd/2022 -3. [](#new) +1. [](#new) * Added twig filter `|field_parent` to get parent field name +2. [](#bugfix) + * Fixed error while deleting retina image in admin # v1.7.29.1 ## 01/31/2022 -3. [](#bugfix) +1. [](#bugfix) * Fixed `Call to undefined method` error when upgrading from Grav 1.6 [#3523](https://github.com/getgrav/grav/issues/3523) # v1.7.29 diff --git a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php index 2bddf97522..36a4503f1b 100644 --- a/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php +++ b/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php @@ -573,6 +573,8 @@ protected function doRemove(string $filename, string $path): void } } } + + $this->hide($filename); } /** From 5eefc917819f89e341941b80e89a879598ff39ee Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 4 Feb 2022 11:23:09 -0800 Subject: [PATCH 04/11] Fixed "Page Authors" field in Security tab, wrongly loading and saving the value (fixes #3525) --- CHANGELOG.md | 1 + system/blueprints/pages/partials/security.yaml | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74df68fd4a..c8d4b3b544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Added twig filter `|field_parent` to get parent field name 2. [](#bugfix) * Fixed error while deleting retina image in admin + * Fixed "Page Authors" field in Security tab, wrongly loading and saving the value [#3525](https://github.com/getgrav/grav/issues/3525) # v1.7.29.1 ## 01/31/2022 diff --git a/system/blueprints/pages/partials/security.yaml b/system/blueprints/pages/partials/security.yaml index d7619b9756..26d8c7dcb0 100644 --- a/system/blueprints/pages/partials/security.yaml +++ b/system/blueprints/pages/partials/security.yaml @@ -51,17 +51,13 @@ form: type: bool header.permissions.authors: - type: list + type: array toggleable: true + value_only: true + placeholder_value: PLUGIN_ADMIN.USERNAME label: PLUGIN_ADMIN.PAGE_AUTHORS help: PLUGIN_ADMIN.PAGE_AUTHORS_HELP - fields: - value: - type: text - placeholder: PLUGIN_ADMIN.USERNAME - style: vertical - header.permissions.groups: ignore@: true type: acl_picker From 88219fbf0eac852249446f5ae32374a620ece2d6 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 7 Feb 2022 10:07:00 +0200 Subject: [PATCH 05/11] Fixed accounts filter only matches against email address [getgrav/grav-plugin-admin#2224] --- CHANGELOG.md | 1 + system/blueprints/flex/user-accounts.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8d4b3b544..d2fa1f4c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ 2. [](#bugfix) * Fixed error while deleting retina image in admin * Fixed "Page Authors" field in Security tab, wrongly loading and saving the value [#3525](https://github.com/getgrav/grav/issues/3525) + * Fixed accounts filter only matches against email address [getgrav/grav-plugin-admin#2224](https://github.com/getgrav/grav-plugin-admin/issues/2224) # v1.7.29.1 ## 01/31/2022 diff --git a/system/blueprints/flex/user-accounts.yaml b/system/blueprints/flex/user-accounts.yaml index 384bf97c01..8d336f9938 100644 --- a/system/blueprints/flex/user-accounts.yaml +++ b/system/blueprints/flex/user-accounts.yaml @@ -122,6 +122,8 @@ config: fields: - key - email + - username + - fullname blueprints: configure: From 3ca58e9ae141c6e0da15cc181bd919688167e444 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 7 Feb 2022 10:11:45 +0200 Subject: [PATCH 06/11] Composer update --- composer.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/composer.lock b/composer.lock index 27632ac380..2153094194 100644 --- a/composer.lock +++ b/composer.lock @@ -2654,12 +2654,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2814,12 +2814,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php74\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Php74\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2894,12 +2894,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2977,12 +2977,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3507,13 +3507,13 @@ "branch-alias": [] }, "autoload": { + "files": [ + "functions.php" + ], "psr-4": { "Codeception\\": "src/Codeception", "Codeception\\Extension\\": "ext" - }, - "files": [ - "functions.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4641,16 +4641,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.4.5", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3" + "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3", - "reference": "150d1fbd82fb71ff76b3bd7f6ea6006d89c5f0c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8a7761f1c520e0dad6e04d862fdc697445457cfe", + "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe", "shasum": "" }, "require": { @@ -4681,7 +4681,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.4.5" + "source": "https://github.com/phpstan/phpstan/tree/1.4.6" }, "funding": [ { @@ -4701,7 +4701,7 @@ "type": "tidelift" } ], - "time": "2022-02-02T19:35:10+00:00" + "time": "2022-02-06T12:56:13+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 7306f164e904ade660d9a142f0557b5bde62e445 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 7 Feb 2022 10:30:25 +0200 Subject: [PATCH 07/11] Fixed groups filter not matching against readableName [getgrav/grav-plugin-admin#2224] --- system/blueprints/flex/user-groups.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/system/blueprints/flex/user-groups.yaml b/system/blueprints/flex/user-groups.yaml index 05ba87b733..a5d348b5aa 100644 --- a/system/blueprints/flex/user-groups.yaml +++ b/system/blueprints/flex/user-groups.yaml @@ -113,6 +113,7 @@ config: fields: - key - groupname + - readableName - description blueprints: From d275532cf8bafec0fb765a010a1a6d73a2c69d18 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 25 Dec 2021 23:08:31 +0100 Subject: [PATCH 08/11] Fix documentation of return type --- system/src/Grav/Common/Twig/Extension/FilesystemExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php b/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php index 9b9085558f..6e5434c4ec 100644 --- a/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php +++ b/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php @@ -283,7 +283,7 @@ public function exif_read_data($file, ?string $required_sections, bool $as_array /** * @param string $filename - * @return string|false + * @return int|false */ public function exif_imagetype($filename) { From 0323a898cb95948344ab329eedcccb251ae45ec1 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 25 Dec 2021 23:08:52 +0100 Subject: [PATCH 09/11] Normalize variable names --- .../Twig/Extension/FilesystemExtension.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php b/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php index 6e5434c4ec..0ae793e620 100644 --- a/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php +++ b/system/src/Grav/Common/Twig/Extension/FilesystemExtension.php @@ -266,19 +266,19 @@ public function getimagesize($filename) } /** - * @param string $file + * @param string $filename * @param string|null $required_sections * @param bool $as_arrays * @param bool $read_thumbnail * @return array|false */ - public function exif_read_data($file, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false) + public function exif_read_data($filename, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false) { - if (!Utils::functionExists('exif_read_data') || !$this->checkFilename($file)) { + if (!Utils::functionExists('exif_read_data') || !$this->checkFilename($filename)) { return false; } - return exif_read_data($file, $required_sections, $as_arrays, $read_thumbnail); + return exif_read_data($filename, $required_sections, $as_arrays, $read_thumbnail); } /** @@ -311,18 +311,18 @@ public function hash_file(string $algo, string $filename, bool $binary = false) /** * @param string $algo - * @param string $data + * @param string $filename * @param string $key * @param bool $binary * @return string|false */ - public function hash_hmac_file(string $algo, string $data, string $key, bool $binary = false) + public function hash_hmac_file(string $algo, string $filename, string $key, bool $binary = false) { - if (!$this->checkFilename($data)) { + if (!$this->checkFilename($filename)) { return false; } - return hash_hmac_file($algo, $data, $key, $binary); + return hash_hmac_file($algo, $filename, $key, $binary); } /** From 5d842349e59947622a7d4fd5eecb9298d2fe4bd2 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 25 Dec 2021 23:03:15 +0100 Subject: [PATCH 10/11] add composer suggestion for exif extension --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2c82dd72dc..5116901043 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,8 @@ "ext-intl": "Recommended for multi-language sites", "ext-memcache": "Needed to support Memcache servers", "ext-memcached": "Needed to support Memcached servers", - "ext-redis": "Needed to support Redis servers" + "ext-redis": "Needed to support Redis servers", + "ext-exif": "Needed to use exif data from images." }, "config": { "apcu-autoloader": true, From b1938c9790033be46a8352ab75e658e6725dcabb Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 7 Feb 2022 12:12:03 -0700 Subject: [PATCH 11/11] 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 d2fa1f4c68..c394dadf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.30 -## mm/dd/2022 +## 02/07/2022 1. [](#new) * Added twig filter `|field_parent` to get parent field name diff --git a/system/defines.php b/system/defines.php index 6520711f3b..39dd692640 100644 --- a/system/defines.php +++ b/system/defines.php @@ -9,7 +9,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.29.1'); +define('GRAV_VERSION', '1.7.30'); define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false);