]> granicus.if.org Git - php/commitdiff
_SERVER also should not be quoted by magic_quotes_GPC
authorShane Caraveo <shane@php.net>
Sun, 30 Mar 2003 01:06:54 +0000 (01:06 +0000)
committerShane Caraveo <shane@php.net>
Sun, 30 Mar 2003 01:06:54 +0000 (01:06 +0000)
also remove an empty if statement

main/php_variables.c

index ced5fe0158d32f4a69ff1131d28073ed168261e2..fd586c6f89c944e12a5ff6a905ac0e00e6347e2e 100644 (file)
@@ -481,11 +481,14 @@ PHPAPI int php_handle_special_queries(TSRMLS_D)
 static inline void php_register_server_variables(TSRMLS_D)
 {
        zval *array_ptr=NULL;
+       /* turn off magic_quotes while importing server variables */
+       int magic_quotes_gpc = PG(magic_quotes_gpc);
 
        ALLOC_ZVAL(array_ptr);
        array_init(array_ptr);
        INIT_PZVAL(array_ptr);
        PG(http_globals)[TRACK_VARS_SERVER] = array_ptr;
+       PG(magic_quotes_gpc) = 0;
 
        /* Server variables */
        if (sapi_module.register_server_variables) {
@@ -504,6 +507,7 @@ static inline void php_register_server_variables(TSRMLS_D)
        if (SG(request_info).auth_password) {
                php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC);
        }
+       PG(magic_quotes_gpc) = magic_quotes_gpc;
 }
 /* }}} */
 
@@ -599,13 +603,8 @@ int php_hash_environment(TSRMLS_D)
                }
        }
 
-       if (!jit_initialization) {
-               if (!have_variables_order) {
-                       php_register_server_variables(TSRMLS_C);
-               }
-               if (!PG(http_globals)[TRACK_VARS_ENV]) {
-
-               }
+       if (!jit_initialization && !have_variables_order) {
+               php_register_server_variables(TSRMLS_C);
        }
 
        for (i=0; i<num_track_vars; i++) {