diff options
-rw-r--r-- | sapi/cgi/cgi_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 2475012984..be9b433142 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -431,6 +431,9 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) if (!FCGX_IsCGI()) { FCGX_Request *request = (FCGX_Request *)SG(server_context); 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 = request->envp; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); @@ -441,6 +444,7 @@ void cgi_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; } /* call php's original import as a catch-all */ php_php_import_environment_variables(array_ptr TSRMLS_CC); |