From 697a6c0a8c1fa601caf201e8a2ea470f312dc11b Mon Sep 17 00:00:00 2001 From: Christoph Amthor Date: Mon, 19 Feb 2024 14:16:59 +0100 Subject: [PATCH] Include functions from global space that are prefixed with \ --- scripts/generate_rules.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/generate_rules.php b/scripts/generate_rules.php index b9887890..f923e5da 100644 --- a/scripts/generate_rules.php +++ b/scripts/generate_rules.php @@ -41,10 +41,14 @@ function help($name) { } foreach(token_get_all($file_content) as $token) { - if ($token[0] !== T_STRING) { + if (!is_array($token)) { continue; } + if (isset($token[1][0]) && '\\' === $token[1][0]) { + $token[1] = substr($token[1], 1); + } + if (in_array($token[1], $functions_blacklist, true)) { $output[] = 'sp.disable_function.function("' . $token[1] . '").filename("' . $name . '")' . $hash . '.allow();' . "\n"; }