Skip to content
Browse files

_SERVER also should not be quoted by magic_quotes_GPC

also remove an empty if statement
  • Loading branch information...
1 parent 47e40e1 commit 0f3a0dfa52983db76df9149f75bc63608efd4d57 Shane Caraveo committed Mar 30, 2003
Showing with 6 additions and 7 deletions.
  1. +6 −7 main/php_variables.c
View
13 main/php_variables.c
@@ -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++) {

0 comments on commit 0f3a0df

Please sign in to comment.
Something went wrong with that request. Please try again.