]> granicus.if.org Git - php/commitdiff
Remove magic quotes legacy
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 17 Nov 2019 20:34:52 +0000 (21:34 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 5 Dec 2019 12:15:54 +0000 (13:15 +0100)
ext/opcache/Optimizer/sccp.c
ext/opcache/Optimizer/zend_func_info.c
ext/standard/basic_functions.c
ext/standard/basic_functions.h
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h
ext/standard/tests/general_functions/bug55371.phpt [deleted file]

index 57ae48b0217ca0483aaff2cfd7629284cce9ccbd..9c21f35d70ec937465dfb939bee0f39fe358e49a 100644 (file)
@@ -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 */
index 5c14ebf3c254a3249f4b340562c0384979ff21a3..a973efdb72908b1b4fc0b85c88ad40b5e134b24d 100644 (file)
@@ -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),
index 1f246a6ba89ac3928ae3bf5e4ab2be00a0886c52..9cb321097f5d6f7f06a4987319fb43985d7bcb51 100755 (executable)
@@ -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
index 140a51dde2a7ad54004c3111f661cc0038190f3d..a010db88f680b63145797049ebaf574ce8742084 100644 (file)
@@ -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);
index 60a26d02ad067c4b4532b5f5b1693c1e7146f7d2..23e22954fcaffd81ee9d851e0b08523b34612c70 100755 (executable)
@@ -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 {}
index 51d0ff7f139b6c3280c6c9568eae6d1e07cc93f3..6e33d6ce311082d6aae55888c89f374f7c00090e 100755 (executable)
@@ -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 (file)
index 5b324db..0000000
+++ /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