Skip to content

Commit

Permalink
Enabled matching on local var in php8
Browse files Browse the repository at this point in the history
PHP8 failed hard when it couldn't find the local variable
we're looking for.
using ZEND_FETCH_CLASS_SILENT makes it silent.
  • Loading branch information
jvoisin committed Dec 31, 2020
1 parent 53f83f8 commit a6c6934
Show file tree
Hide file tree
Showing 26 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion src/sp_var_value.c
Expand Up @@ -50,7 +50,7 @@ static zval *get_local_var(zend_execute_data *ed, const char *var_name) {

static zval *get_constant(const char *value) {
zend_string *name = zend_string_init(value, strlen(value), 0);
zval *zvalue = zend_get_constant_ex(name, NULL, 0);
zval *zvalue = zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT);

zend_string_release(name);
return zvalue;
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var_2.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var.ini
--FILE--
Expand Down
1 change: 0 additions & 1 deletion src/tests/disable_function/disabled_function_param.phpt
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a param
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_param.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on a super global
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_super_global_var.ini
--GET--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable function, bug : https://github.com/jvoisin/snuffleupagus/issues/181
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_functions_drop_include_simulation.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - eval
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_eval_filename.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - filename regexp
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_filename_r.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - include_once
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_include.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - Include (simulation)
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_include.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_local_var_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_local_var_array_key.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var_array_not_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - matching on an array's variable only
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down
Expand Up @@ -2,7 +2,6 @@
Disable functions - match on an array value buried in several levels
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini
--FILE--
Expand Down

0 comments on commit a6c6934

Please sign in to comment.