Skip to content

Commit

Permalink
Include functions from global space that are prefixed with \
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Amthor authored and jvoisin committed Feb 19, 2024
1 parent c505b1c commit 697a6c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/generate_rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit 697a6c0

Please sign in to comment.