#34683 [NEW]: get_browser ignores $_SERVER['HTTP_USER_AGENT'] setting

From: Date: Fri, 30 Sep 2005 05:52:02 +0000
Subject: #34683 [NEW]: get_browser ignores $_SERVER['HTTP_USER_AGENT'] setting
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85786@lists.php.net to get a copy of this message
From: skissane at gmail dot com Operating system: Linux (FC4) PHP version: 5.0.5 PHP Bug Type: Unknown/Other Function Bug description: get_browser ignores $_SERVER['HTTP_USER_AGENT'] setting 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 bug report at http://bugs.php.net/?id=34683&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34683&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34683&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34683&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34683&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34683&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34683&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34683&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34683&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34683&r=support Expected behavior: http://bugs.php.net/fix.php?id=34683&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34683&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34683&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34683&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34683&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34683&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34683&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34683&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34683&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34683&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34683&r=mysqlcfg

« previous php.bugs (#85786) next »