php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39917 No variables in INPUT_SERVER input type
Submitted: 2006-12-21 01:09 UTC Modified: 2006-12-21 12:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: vojtech at x dot cz Assigned: pajoye (profile)
Status: Closed Package: Filter related
PHP Version: 5.2.0 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vojtech at x dot cz
New email:
PHP Version: OS:

 

 [2006-12-21 01:09 UTC] vojtech at x dot cz
Description:
------------
Filter related functions don't detect any variables when I use INPUT_SERVER input type although they are set in $_SERVER  array.

Reproduce code:
---------------
<?php

$var = 'SERVER_NAME';
var_dump(filter_input(INPUT_SERVER, $var));
var_dump($_SERVER[$var]);
var_dump(array_key_exists($var, $_SERVER) == filter_has_var(INPUT_SERVER, $var));


Expected result:
----------------
string(9) "localhost" 
string(9) "localhost" 
bool(true)


Actual result:
--------------
NULL 
string(9) "localhost" 
bool(false)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-21 01:19 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

It was not supported with all SAPI in 5.2.0.

Please try with a snapshot and tell us which SAPI/server you use)
 [2006-12-21 01:43 UTC] vojtech at x dot cz
From phpinfo: Apache/2.2.3 (Debian) PHP/5.2.0-7, Server API Apache 2.0 Handler

I've just found at http://devzone.zend.com/node/view/id/1113:
server and env support may not work in all sapi, for filter 0.11.0 or php 5.2.0

It seems it isn't bug but I think it should be mentioned in PHP documentation at least.
 [2006-12-21 12:16 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

"I've just found at http://devzone.zend.com/node/view/id/1113:
server and env support may not work in all sapi, for filter 0.11.0 or php 5.2.0"

Yes that's why I suggest to try using a snapshot, the SERVER support has been improved. I wrote this article, there is a link in the docs note, the docs will be updated soon to reflect the new changes or additions.

Please try with a more recent version.


 [2006-12-21 12:51 UTC] vojtech at x dot cz
I can't provide any additional feedback as I will not try a snapshot in the near future.

Thank you for clarification.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 23:01:29 2024 UTC