cvs: php4 /ext/standard proc_open.c /main php_variables.c

From: Date: Sun, 23 Mar 2003 19:30:31 +0000
Subject: cvs: php4 /ext/standard proc_open.c /main php_variables.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-19724@lists.php.net to get a copy of this message
shane Sun Mar 23 14:30:31 2003 EDT Modified files: /php4/main php_variables.c /php4/ext/standard proc_open.c Log: The environment should *never* be magic quoted. Index: php4/main/php_variables.c diff -u php4/main/php_variables.c:1.55 php4/main/php_variables.c:1.56 --- php4/main/php_variables.c:1.55 Mon Mar 3 14:37:09 2003 +++ php4/main/php_variables.c Sun Mar 23 14:30:31 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.55 2003/03/03 19:37:09 iliaa Exp $ */ +/* $Id: php_variables.c,v 1.56 2003/03/23 19:30:31 shane Exp $ */ #include <stdio.h> #include "php.h" @@ -345,6 +345,9 @@ 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 @@ php_register_variable(t, p+1, array_ptr TSRMLS_CC); efree(t); } + PG(magic_quotes_gpc) = magic_quotes_gpc; } Index: php4/ext/standard/proc_open.c diff -u php4/ext/standard/proc_open.c:1.10 php4/ext/standard/proc_open.c:1.11 --- php4/ext/standard/proc_open.c:1.10 Mon Feb 17 01:45:37 2003 +++ php4/ext/standard/proc_open.c Sun Mar 23 14:30:31 2003 @@ -15,7 +15,7 @@ | Author: Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c,v 1.10 2003/02/17 06:45:37 shane Exp $ */ +/* $Id: proc_open.c,v 1.11 2003/03/23 19:30:31 shane Exp $ */ #include <stdio.h> #include "php.h" @@ -138,9 +138,6 @@ 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 @@ 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;

« previous php.cvs (#19724) next »