summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2003-03-23 19:30:31 +0000
committerShane Caraveo <shane@php.net>2003-03-23 19:30:31 +0000
commit456b6cbeab2f3d770ba959712313b2c4f1a16c97 (patch)
tree0006bc4c8c52fc7471c31ea7d600b964d51f3465 /main/php_variables.c
parentbadd5fb6fd600b954157d150a407327de45301f1 (diff)
downloadphp-git-456b6cbeab2f3d770ba959712313b2c4f1a16c97.tar.gz
The environment should *never* be magic quoted.
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index ada4495f58..a47980371d 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -345,6 +345,9 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
{
char **env, *p, *t;
+ /* turn off magic_quotes while importing environment variables */
+ int magic_quotes_gpc = PG(magic_quotes_gpc);
+ PG(magic_quotes_gpc) = 0;
for (env = environ; env != NULL && *env != NULL; env++) {
p = strchr(*env, '=');
@@ -355,6 +358,7 @@ void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
php_register_variable(t, p+1, array_ptr TSRMLS_CC);
efree(t);
}
+ PG(magic_quotes_gpc) = magic_quotes_gpc;
}