#34683 [Bgs->Opn]: get_browser ignores $_SERVER['HTTP_USER_AGENT'] setting
| From: | skissane at gmail dot com | Date: | Fri, 30 Sep 2005 08:12:24 +0000 |
| Subject: | #34683 [Bgs->Opn]: get_browser ignores $_SERVER['HTTP_USER_AGENT'] setting | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85793@lists.php.net to get a copy of this message | ||
ID: 34683
User updated by: skissane at gmail dot com
Reported By: skissane at gmail dot com
-Status: Bogus
+Status: Open
Bug Type: Unknown/Other Function
Operating System: Linux (FC4)
PHP Version: 5.0.5
New Comment:
Sniper, what renders this "bogus"? The docs imply it behaves a certain
way... and it doesn't. Either the docs are wrong or the code is wrong
-- either way there is a bug.
Previous Comments:
------------------------------------------------------------------------
[2005-09-30 10:07:30] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2005-09-30 07:52:01] skissane at gmail dot com
Description:
------------
According to the docs "By default, the value of
$_SERVER['HTTP_USER_AGENT'] is used". However, setting this to a
different value does not change the output of get_browser with no
arguments. Indeed, under CLI SAPI, HTTP_USER_AGENT is not set
initially, and even if you set it by hand before calling get_browser()
it still gives an error that it is not set.
Reproduce code:
---------------
Run from CLI SAPI:
<?
$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6";
echo is_object(get_browser($_SERVER["HTTP_USER_AGENT"])) ? "Y" : "N";
echo is_object(get_browser()) ? "Y" : "N";
Expected result:
----------------
YY
Actual result:
--------------
Y
Warning: get_browser(): HTTP_USER_AGENT variable is not set, cannot
determine user agent name in /data/www/simon/Handbook/test.php on line
4
N
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34683&edit=1