From 47665dbddb936a14850ea4a029947621fe700b65 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 15 Jun 2023 09:03:12 -0600 Subject: [PATCH 1/2] Fixes #3727 - filter field being a closure --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Utils.php | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50aca24d3..303ede6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.42.1 +## mm/dd/2023 + +2. [](#improved) + * Quick fix for `isDangerousFunction` when `$name` was a closure [#3727](https://github.com/getgrav/grav/issues/3727) + # v1.7.42 ## 06/14/2023 diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index 14748a558..2f121bbe3 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -2056,17 +2056,19 @@ public static function isDangerousFunction($name): bool 'forward_static_call_array', ]; - $name = strtolower($name); + if (is_string($name)) { + $name = strtolower($name); + } if ($name instanceof \Closure) { return false; } - if (strpos($name, "\\") !== false) { + if (is_array($name) || strpos($name, ":") !== false) { return false; } - if (is_array($name) || strpos($name, ":") !== false) { + if (strpos($name, "\\") !== false) { return false; } From cf6bf7d1ecdb8f8053ff8180513fa8541389df90 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 15 Jun 2023 12:57:46 -0600 Subject: [PATCH 2/2] 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 303ede6b5..3054f0b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.42.1 -## mm/dd/2023 +## 06/15/2023 2. [](#improved) * Quick fix for `isDangerousFunction` when `$name` was a closure [#3727](https://github.com/getgrav/grav/issues/3727) diff --git a/system/defines.php b/system/defines.php index 634cb524a..23a36e3dd 100644 --- a/system/defines.php +++ b/system/defines.php @@ -9,7 +9,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.42'); +define('GRAV_VERSION', '1.7.42.1'); define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false);