From d0d083d985a39ea71aac7b563da71a8c58742f87 Mon Sep 17 00:00:00 2001 From: Andy Miller <1084697+rhukster@users.noreply.github.com> Date: Thu, 23 Feb 2023 18:01:01 -0700 Subject: [PATCH 01/15] not just 7.3! --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cf446dad68..3ffd893599 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,7 @@ "config": { "apcu-autoloader": true, "platform": { - "php": "7.3.6" + "php": ">=7.3.6" } }, "autoload": { From 479b89134d66eaf9ad6464077161b0200fb39c4c Mon Sep 17 00:00:00 2001 From: Andy Miller <1084697+rhukster@users.noreply.github.com> Date: Thu, 23 Feb 2023 18:46:44 -0700 Subject: [PATCH 02/15] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3ffd893599..cf446dad68 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,7 @@ "config": { "apcu-autoloader": true, "platform": { - "php": ">=7.3.6" + "php": "7.3.6" } }, "autoload": { From a888f19ad1ee22147820c14898c46fedf89c851b Mon Sep 17 00:00:00 2001 From: Ari Cooper Davis <8947634+aricooperdavis@users.noreply.github.com> Date: Mon, 6 Mar 2023 16:25:12 +0000 Subject: [PATCH 03/15] Fix LogViewer regex to reduce greediness (#3684) --- system/src/Grav/Common/Helpers/LogViewer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Helpers/LogViewer.php b/system/src/Grav/Common/Helpers/LogViewer.php index 060e5612e2..a862fddb3e 100644 --- a/system/src/Grav/Common/Helpers/LogViewer.php +++ b/system/src/Grav/Common/Helpers/LogViewer.php @@ -21,7 +21,7 @@ class LogViewer { /** @var string */ - protected $pattern = '/\[(?P.*)\] (?P\w+).(?P\w+): (?P.*[^ ]+) (?P[^ ]+) (?P[^ ]+)/'; + protected $pattern = '/\[(?P.*?)\] (?P\w+)\.(?P\w+): (?P.*[^ ]+) (?P[^ ]+) (?P[^ ]+)/'; /** * Get the objects of a tailed file From 0ae980062f63d4211b5bd2f24f19bf196e8a007c Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 6 Mar 2023 18:18:57 +0100 Subject: [PATCH 04/15] Remove outdated setting `xcache` (#3615) Already removed in commit ba2c37c2163edd7bcc6de753e18eba302ffdda75 --- system/blueprints/config/system.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 09e80837d7..14fef03ce9 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -608,7 +608,6 @@ form: file: File apc: APC apcu: APCu - xcache: Xcache memcache: Memcache memcached: Memcached wincache: WinCache From 259c148edbad785fabd696b2c479641abf671a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20=C5=A0umskas?= Date: Mon, 6 Mar 2023 19:19:23 +0200 Subject: [PATCH 05/15] Fix whoami command usage (#3695) Passing process as a string is deprecated since Symfony 4.2. --- system/src/Grav/Common/Scheduler/Scheduler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Scheduler/Scheduler.php b/system/src/Grav/Common/Scheduler/Scheduler.php index 1a1750b637..f4cf4549cd 100644 --- a/system/src/Grav/Common/Scheduler/Scheduler.php +++ b/system/src/Grav/Common/Scheduler/Scheduler.php @@ -357,7 +357,7 @@ private function saveJobStates() */ public function whoami() { - $process = new Process('whoami'); + $process = new Process(['whoami']); $process->run(); if ($process->isSuccessful()) { From 904ec46a9f630de7b66c4de35c4c22847a1703ab Mon Sep 17 00:00:00 2001 From: Anael Mobilia Date: Mon, 6 Mar 2023 18:21:03 +0100 Subject: [PATCH 06/15] Update robots.txt reflecting actual folders (#3625) * Update robots.txt "grav" folder no longer exists * Add folders now existing --- robots.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/robots.txt b/robots.txt index 1d41d40ad5..cb22b6b28e 100644 --- a/robots.txt +++ b/robots.txt @@ -1,16 +1,21 @@ User-agent: * +Disallow: /.github/ +Disallow: /.phan/ +Disallow: /assets/ Disallow: /backup/ Disallow: /bin/ Disallow: /cache/ -Disallow: /grav/ Disallow: /logs/ Disallow: /system/ -Disallow: /vendor/ +Disallow: /tests/ +Disallow: /tmp/ Disallow: /user/ +Disallow: /vendor/ +Disallow: /webserver-configs/ Allow: /user/pages/ Allow: /user/themes/ Allow: /user/images/ Allow: / Allow: *.css$ Allow: *.js$ -Allow: /system/*.js$ \ No newline at end of file +Allow: /system/*.js$ From 5fcf690918b05e1f67986471b2501e564b2067ed Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 6 Mar 2023 10:40:36 -0800 Subject: [PATCH 07/15] Fixed `BlueprintSchema:flattenData` to properly handle ignored fields --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Data/BlueprintSchema.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 223eb8f316..fd6b0ca2ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.39.5 +## mm/dd/2023 + +1. [](#bugfix) + * Fixed `BlueprintSchema:flattenData` to properly handle ignored fields + # v1.7.39.4 ## 02/22/2023 diff --git a/system/src/Grav/Common/Data/BlueprintSchema.php b/system/src/Grav/Common/Data/BlueprintSchema.php index 137e042414..7b34c26a22 100644 --- a/system/src/Grav/Common/Data/BlueprintSchema.php +++ b/system/src/Grav/Common/Data/BlueprintSchema.php @@ -129,7 +129,8 @@ public function flattenData(array $data, bool $includeAll = false, string $name $items = $name !== '' ? $this->getProperty($name)['fields'] ?? [] : $this->items; foreach ($items as $key => $rules) { $type = $rules['type'] ?? ''; - if (!str_starts_with($type, '_') && !str_contains($key, '*')) { + $ignore = (bool) array_filter($rules['validate']['ignore'] ?? []) ?? false; + if (!str_starts_with($type, '_') && !str_contains($key, '*') && $ignore !== true) { $list[$prefix . $key] = null; } } From bd7a74d79e16fcdaf6faf7174ce29d4308950c4f Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 6 Mar 2023 11:01:15 -0800 Subject: [PATCH 08/15] Coerce ignore validation to array to cover both array/non-array values --- system/src/Grav/Common/Data/BlueprintSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Data/BlueprintSchema.php b/system/src/Grav/Common/Data/BlueprintSchema.php index 7b34c26a22..b476706052 100644 --- a/system/src/Grav/Common/Data/BlueprintSchema.php +++ b/system/src/Grav/Common/Data/BlueprintSchema.php @@ -129,7 +129,7 @@ public function flattenData(array $data, bool $includeAll = false, string $name $items = $name !== '' ? $this->getProperty($name)['fields'] ?? [] : $this->items; foreach ($items as $key => $rules) { $type = $rules['type'] ?? ''; - $ignore = (bool) array_filter($rules['validate']['ignore'] ?? []) ?? false; + $ignore = (bool) array_filter((array)($rules['validate']['ignore'] ?? [])) ?? false; if (!str_starts_with($type, '_') && !str_contains($key, '*') && $ignore !== true) { $list[$prefix . $key] = null; } From 60506e6f34d14c393e8d76ba796e1135c9f967fc Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 7 Mar 2023 10:45:01 -0700 Subject: [PATCH 09/15] fixed duplicate page paths --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Page/Pages.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd6b0ca2ef..8a0b4097ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -# v1.7.39.5 +# v1.7.40 ## mm/dd/2023 1. [](#bugfix) + * Fixed an issue with duplicate identical page paths * Fixed `BlueprintSchema:flattenData` to properly handle ignored fields # v1.7.39.4 diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 8fbcb397e0..e39e3ab60b 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -1774,7 +1774,7 @@ protected function getPagesPaths(): array $dirs = (array) $grav['config']->get('system.pages.dirs', ['page://']); foreach ($dirs as $dir) { $path = $locator->findResource($dir); - if (file_exists($path)) { + if (file_exists($path) && !in_array($path, $paths, true)) { $paths[] = $path; } } From 940415dddb832aa4f18419ae5f83af72b60dcb8a Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 7 Mar 2023 10:47:55 -0700 Subject: [PATCH 10/15] updated changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a0b4097ba..8826167816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ # v1.7.40 ## mm/dd/2023 +1. [](#improved) + * Removed outdated `xcache` setting [#3615](https://github.com/getgrav/grav/pull/3615) + * Updated `robots.txt` [#3625](https://github.com/getgrav/grav/pull/3625) 1. [](#bugfix) * Fixed an issue with duplicate identical page paths * Fixed `BlueprintSchema:flattenData` to properly handle ignored fields + * Fixed LogViewer regex greediness [#3684](https://github.com/getgrav/grav/pull/3684) + * Fixed `whoami` command [#3695](https://github.com/getgrav/grav/pull/3695) # v1.7.39.4 ## 02/22/2023 From c261d0d3f749ecf2dc2c9f88cb3aec0bd4bfa785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20=C5=A0umskas?= Date: Fri, 17 Mar 2023 16:53:45 +0200 Subject: [PATCH 11/15] Fix force_ssl redirect in case of undefined hostname (#3702) --- system/src/Grav/Common/Service/PagesServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Service/PagesServiceProvider.php b/system/src/Grav/Common/Service/PagesServiceProvider.php index 52ef5eae3f..0e10d144e1 100644 --- a/system/src/Grav/Common/Service/PagesServiceProvider.php +++ b/system/src/Grav/Common/Service/PagesServiceProvider.php @@ -72,7 +72,7 @@ public function register(Container $container) if ($config->get('system.force_ssl')) { $scheme = $uri->scheme(true); if ($scheme !== 'https') { - $url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + $url = 'https://' . $uri->host() . $uri->uri(); $grav->redirect($url); } } From 9ab7a4759a5d89c23843e606ed95cb44222ea0a0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 22 Mar 2023 10:07:14 -0600 Subject: [PATCH 12/15] Added timestamp: true|false option for assets --- CHANGELOG.md | 2 ++ system/src/Grav/Common/Assets.php | 3 ++- system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8826167816..2813be0af7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.7.40 ## mm/dd/2023 +1. [](#new) + * Added a new `timestamp: true|false` option for individual assets 1. [](#improved) * Removed outdated `xcache` setting [#3615](https://github.com/getgrav/grav/pull/3615) * Updated `robots.txt` [#3625](https://github.com/getgrav/grav/pull/3625) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index 125a5180a7..cd00e1b163 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -268,7 +268,8 @@ protected function addType($collection, $type, $asset, $options) } // Add timestamp - $options['timestamp'] = $this->timestamp; + $timestamp_override = $options['timestamp'] ?? true; + $options['timestamp'] = $this->timestamp && filter_var($timestamp_override, FILTER_VALIDATE_BOOLEAN); // Set order $group = $options['group'] ?? 'head'; diff --git a/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php b/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php index e2d89814d2..d4a223b29f 100644 --- a/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php +++ b/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php @@ -192,6 +192,7 @@ protected function renderQueryString($asset = null) $querystring = ''; $asset = $asset ?? $this->asset; + $attributes = $this->attributes; if (!empty($this->query)) { if (Utils::contains($asset, '?')) { From d82ee029e1303d888b667c113b0a171b317f20d2 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 22 Mar 2023 10:09:06 -0600 Subject: [PATCH 13/15] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2813be0af7..8aac744a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Removed outdated `xcache` setting [#3615](https://github.com/getgrav/grav/pull/3615) * Updated `robots.txt` [#3625](https://github.com/getgrav/grav/pull/3625) 1. [](#bugfix) + * Fixed `force_ssl` redirect in case of undefined hostname [#3702](https://github.com/getgrav/grav/pull/3702) * Fixed an issue with duplicate identical page paths * Fixed `BlueprintSchema:flattenData` to properly handle ignored fields * Fixed LogViewer regex greediness [#3684](https://github.com/getgrav/grav/pull/3684) From 0a061ce95e7c3a5573b401bc238e648e07ea4039 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 22 Mar 2023 10:18:07 -0600 Subject: [PATCH 14/15] bugfix for timestamp logic --- system/src/Grav/Common/Assets.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index cd00e1b163..9c270d9866 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -269,7 +269,12 @@ protected function addType($collection, $type, $asset, $options) // Add timestamp $timestamp_override = $options['timestamp'] ?? true; - $options['timestamp'] = $this->timestamp && filter_var($timestamp_override, FILTER_VALIDATE_BOOLEAN); + + if (filter_var($timestamp_override, FILTER_VALIDATE_BOOLEAN)) { + $options['timestamp'] = $this->timestamp; + } else { + $options['timestamp'] = null; + } // Set order $group = $options['group'] ?? 'head'; From 1e2792874dc9c3adffb05dece54f835f3a9b916f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 22 Mar 2023 11:29:52 -0600 Subject: [PATCH 15/15] 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 8aac744a63..a134907f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.40 -## mm/dd/2023 +## 03/22/2023 1. [](#new) * Added a new `timestamp: true|false` option for individual assets diff --git a/system/defines.php b/system/defines.php index 2856310923..6945cd1e7c 100644 --- a/system/defines.php +++ b/system/defines.php @@ -9,7 +9,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.39.4'); +define('GRAV_VERSION', '1.7.40'); define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false);