diff options
| author | Christoph Amthor | 2024-02-19 14:16:59 +0100 |
|---|---|---|
| committer | Julien Voisin | 2024-02-19 16:14:06 +0100 |
| commit | 697a6c0a8c1fa601caf201e8a2ea470f312dc11b (patch) | |
| tree | 2c4d016a297415a9fe013fbd09bc350a3b6ce9b3 | |
| parent | c505b1c3fb8df3eb9c7b3568c4996d095f1583a6 (diff) | |
Include functions from global space that are prefixed with \
| -rw-r--r-- | scripts/generate_rules.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/generate_rules.php b/scripts/generate_rules.php index b988789..f923e5d 100644 --- a/scripts/generate_rules.php +++ b/scripts/generate_rules.php | |||
| @@ -41,10 +41,14 @@ foreach($objects as $name => $object){ | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | foreach(token_get_all($file_content) as $token) { | 43 | foreach(token_get_all($file_content) as $token) { |
| 44 | if ($token[0] !== T_STRING) { | 44 | if (!is_array($token)) { |
| 45 | continue; | 45 | continue; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | if (isset($token[1][0]) && '\\' === $token[1][0]) { | ||
| 49 | $token[1] = substr($token[1], 1); | ||
| 50 | } | ||
| 51 | |||
| 48 | if (in_array($token[1], $functions_blacklist, true)) { | 52 | if (in_array($token[1], $functions_blacklist, true)) { |
| 49 | $output[] = 'sp.disable_function.function("' . $token[1] . '").filename("' . $name . '")' . $hash . '.allow();' . "\n"; | 53 | $output[] = 'sp.disable_function.function("' . $token[1] . '").filename("' . $name . '")' . $hash . '.allow();' . "\n"; |
| 50 | } | 54 | } |
