#50267 [NEW]: get_browser with null parameter runs on empty user agent string
From: nachumk at gmail dot com
Operating system: Windows XP 32 bit
PHP version: 5.3.1
PHP Bug Type: Unknown/Other Function
Bug description: get_browser with null parameter runs on empty user agent string
Description:
------------
get_browser should work with null string and doesn't when using 5.3.1.
5.2.11 works fine.
Reproduce code:
---------------
<?php
phpinfo();
echo "User Agent: " . $_SERVER['HTTP_USER_AGENT'] . "<br>";
echo 'print_r(get_browser($_SERVER[\'HTTP_USER_AGENT\'], true));<br>';
print_r(get_browser($_SERVER['HTTP_USER_AGENT'], true));
echo '<br>print_r(get_browser(null, true))<br>';
print_r(get_browser(null, true));
?>
Expected result:
----------------
That both get_browser calls should produce identical results.
Actual result:
--------------
The first call with $_SERVER['HTTP_USER_AGENT'] returns proper results
and the call with null returns a default response (same as what it would
return with a completely empty user agent string).
--
Edit bug report at http://bugs.php.net/?id=50267&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50267&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50267&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50267&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50267&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50267&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50267&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50267&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50267&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50267&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50267&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50267&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50267&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50267&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50267&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50267&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50267&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50267&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50267&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50267&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50267&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50267&r=mysqlcfg
Thread (11 messages)
- nachumk at gmail dot com
- nachumk at gmail dot com#50267 [Opn]: get_browser with null parameter runs on empty user agent string
- jani@php.net#50267 [Opn->Fbk]: get_browser with null parameter runs on empty user agent string
- nachumk at gmail dot com#50267 [Fbk->Opn]: get_browser with null parameter runs on empty user agent string
- jani@php.net#50267 [Opn->Fbk]: get_browser with null parameter runs on empty user agent string
- nachumk at gmail dot com#50267 [Fbk->Opn]: get_browser with null parameter runs on empty user agent string
- jani@php.net#50267 [Opn->Fbk]: get_browser with null parameter runs on empty user agent string
- nachumk at gmail dot com#50267 [Fbk->Opn]: get_browser with null parameter runs on empty user agent string
- jani@php.net#50267 [Opn->Fbk]: get_browser with null parameter runs on empty user agent string
- jani@php.net#50267 [Fbk->Csd]: get_browser with null parameter runs on empty user agent string
- nachumk at gmail dot com#50267 [Csd]: get_browser with null parameter runs on empty user agent string