diff options
author | Shane Caraveo <shane@php.net> | 2003-03-23 19:30:31 +0000 |
---|---|---|
committer | Shane Caraveo <shane@php.net> | 2003-03-23 19:30:31 +0000 |
commit | 456b6cbeab2f3d770ba959712313b2c4f1a16c97 (patch) | |
tree | 0006bc4c8c52fc7471c31ea7d600b964d51f3465 | |
parent | badd5fb6fd600b954157d150a407327de45301f1 (diff) | |
download | php-git-456b6cbeab2f3d770ba959712313b2c4f1a16c97.tar.gz |
The environment should *never* be magic quoted.
-rw-r--r-- | ext/standard/proc_open.c | 6 | ||||
-rw-r--r-- | main/php_variables.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 58f1c29ade..1ab6f44b0c 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -138,9 +138,6 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent strcat(p, "="); strcat(p, data); - if (PG(magic_quotes_gpc)) { - php_stripslashes(p, &l TSRMLS_CC); - } #ifndef PHP_WIN32 *ep = p; ++ep; @@ -149,9 +146,6 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent break; case HASH_KEY_IS_LONG: memcpy(p,data,el_len); - if (PG(magic_quotes_gpc)) { - php_stripslashes(p, &el_len TSRMLS_CC); - } #ifndef PHP_WIN32 *ep = p; ++ep; 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; } |