summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-03-20 10:21:07 +0100
committerOndřej Surý <ondrej@sury.org>2012-03-21 08:44:59 +0100
commitd1fd5432e1576865dbeb7650b7c7e0fa0bd3a4e1 (patch)
treed29b55e2c069317c5b12c669a5678448e6be9245 /sapi/cgi/cgi_main.c
parent4a6d9b348febe7895a2748977898c09b6e40a7ce (diff)
downloadphp-git-d1fd5432e1576865dbeb7650b7c7e0fa0bd3a4e1.tar.gz
Fixed bug #61043 (Regression in magic_quotes_gpc fix for CVE-2012-0831)
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 6444781747..dfd77e49d3 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -624,7 +624,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
/* turn off magic_quotes while importing environment variables */
- if (PG(magic_quotes_gpc)) {
+ if (magic_quotes_gpc) {
zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
}
for (zend_hash_internal_pointer_reset_ex(request->env, &pos);
@@ -638,7 +638,9 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
php_register_variable_safe(var, *val, new_val_len, array_ptr TSRMLS_CC);
}
}
- PG(magic_quotes_gpc) = magic_quotes_gpc;
+ if (magic_quotes_gpc) {
+ zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "1", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
+ }
}
}