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"; }