From: [EMAIL PROTECTED] Operating system: Various PHP version: 4.3.0 PHP Bug Type: Unknown/Other Function Bug description: get_browser() still has bugs
I am the developer who maintains the browscap.ini file that is recommended by PHP. Despite some recent bug fixes there still seems to be at least one bug in the get_browser() function. Simply put, multiple question marks surrounded by white space in a user agent definition in browscap.ini creates some sort of error that results in a valid user agent not being recognized by get_browser(). Here's a more detailed example of what I mean. user agent: Mozilla/4.8 [en] (Windows NT 5.0; U) original browscap.ini definition: Mozilla/4.8 ???? (Windows NT 5.0; U) updated browscap.ini definition: Mozilla/4.8*(Windows NT 5.0; U) The original definition resulted in the user agent not being found and the Default browser being returned. The updated definition works fine. This forms the basis of my theory about multiple question marks surrounded by white space. By the way, both definitions are valid and both work just fine on other platforms such as ASP. With the help of a fellow developer we did some further testing to confirm my theory. The following user agent definitions did not result in a match when presented with a user agent that should have created a match: Mozilla/4.76C-CCK-MCD ???? (X11; ?; SunOS 5.? sun4u) Mozilla/4.76C-CCK-MCD vg_472 ???? (X11; ?; SunOS 5.8 sun4u) Mozilla/4.76C-SGI ???? (X11; ?; IRIX64 6.5 IP30) Mozilla/4.79C-CCK-MCD ???? (X11; ?; SunOS 5.6 sun4u) But these did result in matches: Mozilla/4.79 ????*(Win95; ?) Mozilla/4.78 (Windows 2000; U) Opera 6.05 ???? Mozilla/5.0 (BeOS; ?; BeOS BePC; ?????; rv:1.0.?) Gecko/???????? This seems to suggest a problem only when multiple question marks are surrounded on both sides by white space. I hope this is enough information for someone to attempt a fix. -- Edit bug report at http://bugs.php.net/?id=21468&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21468&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21468&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21468&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21468&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21468&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21468&r=support Expected behavior: http://bugs.php.net/fix.php?id=21468&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21468&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21468&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21468&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21468&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21468&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21468&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21468&r=gnused