iliaa Fri Jul 29 11:43:37 2005 EDT Modified files: /php-src NEWS /php-src/main php_variables.c Log: Fixed bug #33904 (input array keys being escaped when magic quotes is off). http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2013&r2=1.2014&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2013 php-src/NEWS:1.2014 --- php-src/NEWS:1.2013 Fri Jul 29 09:25:31 2005 +++ php-src/NEWS Fri Jul 29 11:43:36 2005 @@ -2,6 +2,8 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2005, PHP 5.1 - Fixed bug #33917 (number_format() output with > 1 char separators). (Jani) +- Fixed bug #33904 (input array keys being escaped when magic quotes is off). + (Ilia) - Fixed bug #33899 (CLI: setting extension_dir=some/path extension=foobar.so does not work). (Jani) - Fixed bug #33882 (CLI was looking for php.ini in wrong path). (Hartmut) http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.101&r2=1.102&ty=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.101 php-src/main/php_variables.c:1.102 --- php-src/main/php_variables.c:1.101 Mon Jul 25 18:37:35 2005 +++ php-src/main/php_variables.c Fri Jul 29 11:43:37 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.101 2005/07/25 22:37:35 rasmus Exp $ */ +/* $Id: php_variables.c,v 1.102 2005/07/29 15:43:37 iliaa Exp $ */ #include <stdio.h> #include "php.h" @@ -183,7 +183,13 @@ zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } else { zval **tmp; - char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); + char *escaped_index; + + if (PG(magic_quotes_gpc)) { + escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); + } else { + escaped_index = index; + } /* * According to rfc2965, more specific paths are listed above the less specific ones. * If we encounter a duplicate cookie name, we should skip it, since it is not possible @@ -196,7 +202,9 @@ break; } zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - efree(escaped_index); + if (PG(magic_quotes_gpc)) { + efree(escaped_index); + } } break; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php