]> granicus.if.org Git - php/commitdiff
Use ZE API to modify/restore PG(magic_quotes_runtime). Removed overhead at request...
authorDmitry Stogov <dmitry@php.net>
Mon, 5 Jul 2010 14:32:29 +0000 (14:32 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 5 Jul 2010 14:32:29 +0000 (14:32 +0000)
ext/standard/basic_functions.c

index 0fd0fe4fbf5c7217fecdd921e966fae5ef782ee8..1a745a43b4133343c6a79e9281fbbcf401232a89 100644 (file)
@@ -3682,9 +3682,6 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */
        PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
        PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
 
-       /* Reset magic_quotes_runtime */
-       PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime");
-
        /* Setup default context */
        FG(default_context) = NULL;
 
@@ -4534,7 +4531,9 @@ PHP_FUNCTION(set_magic_quotes_runtime)
                return;
        }
 
-       PG(magic_quotes_runtime) = new_setting;
+       if (zend_alter_ini_entry_ex("magic_quotes_runtime", sizeof("magic_quotes_runtime"), new_setting ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+               RETURN_FALSE;
+       }
        RETURN_TRUE;
 }
 /* }}} */