Skip to content

Commit

Permalink
Fixes #3727 - filter field being a closure
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jun 15, 2023
1 parent 5b89091 commit 47665db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 5 additions & 3 deletions system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 47665db

Please sign in to comment.