From: Máté Kocsis Date: Sun, 17 Nov 2019 20:34:52 +0000 (+0100) Subject: Remove magic quotes legacy X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29ef07728eec6323efcff124fc1a6436252b0c35;p=php Remove magic quotes legacy --- diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c index 57ae48b021..9c21f35d70 100644 --- a/ext/opcache/Optimizer/sccp.c +++ b/ext/opcache/Optimizer/sccp.c @@ -786,9 +786,7 @@ static inline int ct_eval_func_call( int overflow; if (num_args == 0) { - if (zend_string_equals_literal(name, "get_magic_quotes_gpc") - || zend_string_equals_literal(name, "get_magic_quotes_gpc_runtime") - || zend_string_equals_literal(name, "php_sapi_name") + if (zend_string_equals_literal(name, "php_sapi_name") || zend_string_equals_literal(name, "imagetypes") || zend_string_equals_literal(name, "phpversion")) { /* pass */ diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index 5c14ebf3c2..a973efdb72 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -274,8 +274,6 @@ static const func_info_t func_infos[] = { F1("quoted_printable_encode", MAY_BE_STRING), F1("get_current_user", MAY_BE_STRING), F1("get_cfg_var", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), - F0("get_magic_quotes_gpc", MAY_BE_FALSE), - F0("get_magic_quotes_runtime", MAY_BE_FALSE), F1("error_get_last", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING), FN("call_user_func", UNKNOWN_INFO), FN("call_user_func_array", UNKNOWN_INFO), diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 1f246a6ba8..9cb321097f 100755 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1136,9 +1136,6 @@ static const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(header_register_callback, arginfo_header_register_callback) PHP_FE(get_cfg_var, arginfo_get_cfg_var) - PHP_DEP_FE(get_magic_quotes_gpc, arginfo_get_magic_quotes_gpc) - PHP_DEP_FE(get_magic_quotes_runtime, arginfo_get_magic_quotes_runtime) - PHP_FE(error_log, arginfo_error_log) PHP_FE(error_get_last, arginfo_error_get_last) PHP_FE(error_clear_last, arginfo_error_clear_last) @@ -2881,28 +2878,6 @@ PHP_FUNCTION(get_cfg_var) } /* }}} */ -/* {{{ proto false get_magic_quotes_runtime(void) - Get the current active configuration setting of magic_quotes_runtime */ -PHP_FUNCTION(get_magic_quotes_runtime) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto false get_magic_quotes_gpc(void) - Get the current active configuration setting of magic_quotes_gpc */ -PHP_FUNCTION(get_magic_quotes_gpc) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - RETURN_FALSE; -} -/* }}} */ - /* 1st arg = error message 2nd arg = error option diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 140a51dde2..a010db88f6 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -72,8 +72,6 @@ PHP_FUNCTION(set_time_limit); PHP_FUNCTION(header_register_callback); PHP_FUNCTION(get_cfg_var); -PHP_FUNCTION(get_magic_quotes_runtime); -PHP_FUNCTION(get_magic_quotes_gpc); PHP_FUNCTION(error_log); PHP_FUNCTION(error_get_last); diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 60a26d02ad..23e22954fc 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -273,10 +273,6 @@ function get_current_user(): string {} function get_cfg_var(string $option_name): string|array|false {} -function get_magic_quotes_runtime(): bool {} - -function get_magic_quotes_gpc(): bool {} - function error_log(string $message, int $message_type = 0, string $destination = UNKNOWN, string $extra_headers = UNKNOWN): bool {} function error_get_last(): ?array {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 51d0ff7f13..6e33d6ce31 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -427,10 +427,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_cfg_var, 0, 1, MAY_BE_STRING ZEND_ARG_TYPE_INFO(0, option_name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_get_magic_quotes_runtime arginfo_ob_flush - -#define arginfo_get_magic_quotes_gpc arginfo_ob_flush - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_log, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message_type, IS_LONG, 0) diff --git a/ext/standard/tests/general_functions/bug55371.phpt b/ext/standard/tests/general_functions/bug55371.phpt deleted file mode 100644 index 5b324db599..0000000000 --- a/ext/standard/tests/general_functions/bug55371.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #55371 (get_magic_quotes_gpc() and get_magic_quotes_runtime() throw deprecated warning) ---FILE-- - ---EXPECTF-- -Deprecated: Function get_magic_quotes_gpc() is deprecated in %s on line %d - -Deprecated: Function get_magic_quotes_runtime() is deprecated in %s on line %d -done