diff options
author | Shane Caraveo <shane@php.net> | 2003-03-23 20:16:41 +0000 |
---|---|---|
committer | Shane Caraveo <shane@php.net> | 2003-03-23 20:16:41 +0000 |
commit | ac7748cef13f5e2f02813f22c31535f344997b97 (patch) | |
tree | d1ddb76439dd5a7719ab46b8cbf23aca6216adf7 | |
parent | 456b6cbeab2f3d770ba959712313b2c4f1a16c97 (diff) | |
download | php-git-ac7748cef13f5e2f02813f22c31535f344997b97.tar.gz |
For fastcgi env vars, don't magic quote them
-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); |