dmitry Wed May 24 07:55:38 2006 UTC Modified files: (Branch: PHP_5_1) /php-src NEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #37341 ($_SERVER in included file is shortened to two entries, if $_ENV gets used). http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.554&r2=1.2027.2.555&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.554 php-src/NEWS:1.2027.2.555 --- php-src/NEWS:1.2027.2.554 Thu May 18 13:21:44 2006 +++ php-src/NEWS Wed May 24 07:55:37 2006 @@ -7,6 +7,8 @@ method). (Tony) - Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of request). (Tony) +- Fixed bug #37341 ($_SERVER in included file is shortened to two entries, + if $_ENV gets used). (Dmitry) - Fixed bug #37313 (sigemptyset() used without including <signal.h>). (jdolecek) - Fixed bug #37346 (invalid colormap format) (Pierre) http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15&r2=1.267.2.16&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15 php-src/sapi/cgi/cgi_main.c:1.267.2.16 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15 Wed May 3 19:40:58 2006 +++ php-src/sapi/cgi/cgi_main.c Wed May 24 07:55:38 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.267.2.15 2006/05/03 19:40:58 tony2001 Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.16 2006/05/24 07:55:38 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -432,14 +432,18 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { if (PG(http_globals)[TRACK_VARS_ENV] && - array_ptr != PG(http_globals)[TRACK_VARS_ENV]) { + array_ptr != PG(http_globals)[TRACK_VARS_ENV] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } else if (PG(http_globals)[TRACK_VARS_SERVER] && - array_ptr != PG(http_globals)[TRACK_VARS_SERVER]) { + array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; INIT_PZVAL(array_ptr);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php