php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44779 filter returns NULL in CLI when it shouldn't
Submitted: 2008-04-18 17:45 UTC Modified: 2008-07-24 09:13 UTC
From: philip@php.net Assigned:
Status: Closed Package: Filter related
PHP Version: 5.3CVS-2008-04-18 (snap) OS: Mac
Private report: No CVE-ID: None
 [2008-04-18 17:45 UTC] philip@php.net
Description:
------------
The filter extension appears to have issues with CLI. I have not fully tested it but will provide examples below to demonstrate the problem.

These tests use INPUT_SERVER, but others may be affected. Note: The same code is working correctly for me in mod_php.

Reproduce code:
---------------
philip$ cat > foo.php
<?php
var_dump( filter_input(INPUT_SERVER, 'PHP_SELF') );
var_dump( $_SERVER['PHP_SELF'] );
^C
philip$ php foo.php 
NULL
string(7) "foo.php"

philip$ php -r 'var_dump($_SERVER["PHP_SELF"]);'
string(1) "-"
philip$ php -r 'var_dump( filter_input(INPUT_SERVER, "PHP_SELF"));'
NULL



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-24 09:13 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC