php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71063 filter_input(INPUT_ENV, ..) does not work
Submitted: 2015-12-08 14:46 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: sander at hoentjen dot eu Assigned:
Status: Closed Package: Filter related
PHP Version: 7.0.0 OS: Linux (Fedora)
Private report: No CVE-ID: None
 [2015-12-08 14:46 UTC] sander at hoentjen dot eu
Description:
------------
With PHP 7 it seems filter_input(INPUT_ENV, 'PATH') does not work anymore. It returns NULL whereas previous PHP versions returned the same as $_ENV['PATH']

It is not just the PATH variable, the whole function filter_input_array(INPUT_ENV) returns NULL, even though $_ENV is not empty.

variables_order is set to "EGPCS"

This looks similar to https://bugs.php.net/bug.php?id=52209

Test script:
---------------
var_dump($_ENV['PATH']); // to check if it really has data
var_dump(filter_input(INPUT_ENV, 'PATH')); // this returns NULL, but should return the same as the previous command

Expected result:
----------------
string(59) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
string(59) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"


Actual result:
--------------
string(59) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-08 16:10 UTC] reeze@php.net
Automatic comment on behalf of reeze
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3427c122bf02488559ef5fdf0e9403396c30a5f1
Log: Fixed bug #71063 (filter_input(INPUT_ENV, ..) does not work)
 [2015-12-08 16:10 UTC] reeze@php.net
-Status: Open +Status: Closed
 [2015-12-08 16:12 UTC] reeze@php.net
Automatic comment on behalf of reeze
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3427c122bf02488559ef5fdf0e9403396c30a5f1
Log: Fixed bug #71063 (filter_input(INPUT_ENV, ..) does not work)
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of reeze
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3427c122bf02488559ef5fdf0e9403396c30a5f1
Log: Fixed bug #71063 (filter_input(INPUT_ENV, ..) does not work)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC