mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Revert "Fix bug #62397 - disable_functions does not work with eval."
This reverts commit 050d299364
.
This commit is contained in:
parent
f349d790b4
commit
ff96f25b12
@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
errmsg: disabled eval function
|
||||
--INI--
|
||||
disable_functions=eval
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
eval('echo "Eval";');
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: eval() has been disabled for security reasons in %s on line %d
|
||||
Done
|
@ -2757,12 +2757,6 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_lengt
|
||||
|
||||
/* Disabled functions support */
|
||||
|
||||
static ZEND_COLD zend_op_array *display_disabled_compile_string(zval *source_string, char *filename)
|
||||
{
|
||||
zend_error(E_WARNING, "eval() has been disabled for security reasons");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* {{{ proto void display_disabled_function(void)
|
||||
Dummy function which displays an error when a disabled function is called. */
|
||||
ZEND_API ZEND_COLD ZEND_FUNCTION(display_disabled_function)
|
||||
@ -2774,12 +2768,6 @@ ZEND_API ZEND_COLD ZEND_FUNCTION(display_disabled_function)
|
||||
ZEND_API int zend_disable_function(char *function_name, size_t function_name_length) /* {{{ */
|
||||
{
|
||||
zend_internal_function *func;
|
||||
|
||||
if (strcmp(function_name, "eval") == 0) {
|
||||
zend_compile_string = display_disabled_compile_string;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if ((func = zend_hash_str_find_ptr(CG(function_table), function_name, function_name_length))) {
|
||||
func->fn_flags &= ~(ZEND_ACC_VARIADIC | ZEND_ACC_HAS_TYPE_HINTS | ZEND_ACC_HAS_RETURN_TYPE);
|
||||
func->num_args = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user