summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
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;
}