From: Ilia Alshanetsky Date: Wed, 22 Dec 2010 16:18:59 +0000 (+0000) Subject: Fixed bug #52209 (INPUT_ENV returns NULL for set variables (CLI)). X-Git-Tag: php-5.3.6RC1~193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a68864969e459013e8e9c83b8604277cf9d59b89;p=php Fixed bug #52209 (INPUT_ENV returns NULL for set variables (CLI)). --- diff --git a/NEWS b/NEWS index 849d9ddb80..f9188ecb81 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ - Filter extension: . Fixed bug #53150 (FILTER_FLAG_NO_RES_RANGE is missing some IP ranges). (Ilia) + . Fixed bug #52209 (INPUT_ENV returns NULL for set variables (CLI)). (Ilia) . Fixed bug #47435 (FILTER_FLAG_NO_RES_RANGE don't work with ipv6). (Ilia, valli at icsurselva dot ch) diff --git a/ext/filter/filter.c b/ext/filter/filter.c index d6f2090b3a..a9753891a3 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -559,7 +559,7 @@ static zval *php_filter_get_storage(long arg TSRMLS_DC)/* {{{ */ if (jit_initialization) { zend_is_auto_global("_ENV", sizeof("_ENV")-1 TSRMLS_CC); } - array_ptr = IF_G(env_array); + array_ptr = IF_G(env_array) ? IF_G(env_array) : PG(http_globals)[TRACK_VARS_ENV]; break; case PARSE_SESSION: /* FIXME: Implement session source */ diff --git a/ext/filter/tests/bug52209.phpt b/ext/filter/tests/bug52209.phpt new file mode 100644 index 0000000000..49408ea12d --- /dev/null +++ b/ext/filter/tests/bug52209.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #52209 (INPUT_ENV returns NULL for set variables (CLI)) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +string(%d) "%s"