Skip to content

Commit

Permalink
Merge branch 'PHP-7.0'
Browse files Browse the repository at this point in the history
* PHP-7.0:
  Fixed bug #71063 (filter_input(INPUT_ENV, ..) does not work)
  • Loading branch information
reeze committed Dec 8, 2015
2 parents 2cc2396 + 3427c12 commit 2ff2ef3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/filter/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static zval *php_filter_get_storage(zend_long arg)/* {{{ */
if (PG(auto_globals_jit)) {
zend_is_auto_global_str(ZEND_STRL("_ENV"));
}
array_ptr = &IF_G(env_array) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
array_ptr = !Z_ISUNDEF(IF_G(env_array)) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
break;
case PARSE_SESSION:
/* FIXME: Implement session source */
Expand Down
12 changes: 12 additions & 0 deletions ext/filter/tests/bug71063.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Bug #71063 filter_input(INPUT_ENV, ..) does not work
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(count($_ENV['PATH']) > 0);
var_dump(count(filter_input(INPUT_ENV, 'PATH')) > 0);
?>
--EXPECT--
bool(true)
bool(true)

0 comments on commit 2ff2ef3

Please sign in to comment.