com php-src: Remove magic quotes legacy: ext/opcache/Optimizer/sccp.c ext/opcache/Optimizer/zend_func_info.c ext/standard/bas ic_functions.c
ext/standard/basic_functions.h ext/s tandard/basic_functions.stub.php ext/standard/basic_f unctions_arginfo.h ext/standard/tests/general_functions
/bug55371.phpt
| From: | Máté Kocsis | Date: | Thu, 05 Dec 2019 12:15:54 +0000 |
| Subject: | com php-src: Remove magic quotes legacy: ext/opcache/Optimizer/sccp.c ext/opcache/Optimizer/zend_func_info.c ext/standard/bas ic_functions.c ext/standard/basic_functions.h ext/s tandard/basic_functions.stub.php ext/standard/basic_f unctions_arginfo.h ext/standard/tests/general_functions /bug55371.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109393@lists.php.net to get a copy of this message | ||
Commit: 29ef07728eec6323efcff124fc1a6436252b0c35
Author: Máté Kocsis <kocsismate@woohoolabs.com> Sun, 17 Nov 2019 21:34:52 +0100
Parents: 633926021bd9657f098b3b0441cf9a4477b8d80f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=29ef07728eec6323efcff124fc1a6436252b0c35
Log:
Remove magic quotes legacy
Changed paths:
M ext/opcache/Optimizer/sccp.c
M ext/opcache/Optimizer/zend_func_info.c
M ext/standard/basic_functions.c
M ext/standard/basic_functions.h
M ext/standard/basic_functions.stub.php
M ext/standard/basic_functions_arginfo.h
D ext/standard/tests/general_functions/bug55371.phpt
Diff:
diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c
index 57ae48b0217..9c21f35d70e 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 5c14ebf3c25..a973efdb729 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 1f246a6ba89..9cb321097f5 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 140a51dde2a..a010db88f68 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 60a26d02ad0..23e22954fca 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 51d0ff7f139..6e33d6ce311 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 5b324db5996..00000000000
--- 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--
-<?php
-
-get_magic_quotes_gpc();
-get_magic_quotes_runtime();
-
-echo 'done';
-
-?>
---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