From f558f62469b06098a77f95579dcf0ba5675c801c Mon Sep 17 00:00:00 2001 From: bohwaz Date: Sun, 24 Mar 2024 19:07:25 +0100 Subject: [PATCH] Don't forbid use of assert in PHP 8+ --- scripts/generate_rules.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/generate_rules.php b/scripts/generate_rules.php index 1824e3fa..d35c72f4 100644 --- a/scripts/generate_rules.php +++ b/scripts/generate_rules.php @@ -12,7 +12,12 @@ function help($name) { 'posix_kill', 'posix_mkfifo', 'posix_setpgid', 'posix_setsid', 'posix_setuid', 'posix_setgid', 'posix_uname', 'proc_close', 'proc_nice', 'proc_open', 'proc_terminate', 'proc_open', 'proc_get_status', 'dl', 'pnctl_exec', - 'pnctl_fork', 'assert', 'system', 'curl_exec', 'curl_multi_exec', 'function_exists']; + 'pnctl_fork', 'system', 'curl_exec', 'curl_multi_exec', 'function_exists']; + +// In PHP < 8.0x you could execute code using assert() +if (PHP_VERSION_ID < 80000) { + $functions_blacklist[] = 'assert'; +} $extensions = ['php', 'php7', 'php5', 'inc'];