get_browser with null parameter runs on empty user agent string
| Bug #50267 | get_browser with null parameter runs on empty user agent string | ||||
|---|---|---|---|---|---|
| Submitted: | 2009-11-23 05:18 UTC | Modified: | 2009-11-24 02:39 UTC | ||
| From: | nachumk at gmail dot com | Assigned: | |||
| Status: | Closed | Package: | *General Issues | ||
| PHP Version: | 5.3.1 | OS: | Windows XP 32 bit | ||
| Private report: | No | CVE-ID: | None | ||
[2009-11-23 05:18 UTC] nachumk at gmail dot com
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).
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-11-23 05:20 UTC] nachumk at gmail dot com
[2009-11-24 00:18 UTC] jani@php.net
[2009-11-24 02:39 UTC] nachumk at gmail dot com