summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2003-03-30 01:06:54 +0000
committerShane Caraveo <shane@php.net>2003-03-30 01:06:54 +0000
commit0f3a0dfa52983db76df9149f75bc63608efd4d57 (patch)
tree5cb9e869623c879d0a33599de555ce871b3e1f70 /main/php_variables.c
parent47e40e1b98bcb0c3c69fbd65612340fd90309cf2 (diff)
downloadphp-git-0f3a0dfa52983db76df9149f75bc63608efd4d57.tar.gz
_SERVER also should not be quoted by magic_quotes_GPC
also remove an empty if statement
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index ced5fe0158..fd586c6f89 100644
--- a/main/php_variables.c
+++ b/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++) {