ID: 24548 Updated by: [EMAIL PROTECTED] Reported By: mikx at mikx dot de -Status: Assigned +Status: Feedback Bug Type: Unknown/Other Function Operating System: * PHP Version: 4.3.2 Assigned To: jay New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip This has been fixed in CVS for PHP 5 and I've merged the changes over. Try the next snapshot and see if it provides better matches. It reports Win2000 now for your example, others should work as well. J Previous Comments: ------------------------------------------------------------------------ [2003-07-09 07:33:04] [EMAIL PROTECTED] Jay, can you look into this? ------------------------------------------------------------------------ [2003-07-09 06:12:33] alexandre dot alapetite at risoe dot dk It seems that there is a problem with the get_browser() function. It is not respecting the browscap.ini format. For example (with IE6.0 Win2000) in the browscap.ini we can find [IE 6.0] which are the generic values for all IE6 browsers. And is the this wrong one that is returned by get_browser() since the "IE 6.0" pattern is contained in the user agent string "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)". The good match in browscap.ini for IE6 Win2000 should be [Mozilla/4\.0 (compatible; MSIE 6\.0.*;.*Windows NT 5\.0.*).*] The solution for IE6 is to replace in browscap.ini [IE 6.0] by [Internet Explorer 6.0] and parent=IE 6.0 by parent=Internet Explorer 6.0 This way it will return also the platform, the browser, etc... But PHP should update the way they analyse regular expressions from browscap.ini which are in fact of the form [^xxx$]. That meens that expressions in browscap.ini are always full pattern and not just a peace. Hope it will be corrected soon. ------------------------------------------------------------------------ [2003-07-08 18:44:56] mikx at mikx dot de Seems to be a bug in 4.3.2 - downgraded to 4.3.0 and get_browser() is able to detect the platform of much more HTTP_USER_AGENT strings now. ------------------------------------------------------------------------ [2003-07-08 16:44:11] mikx at mikx dot de Just figured out that get_browser() does not return a fixed set of informations - the platform information is only given if resolved. It can't resolve most versions of Internet Explorer 6, not sure if this is a bug or a weakness of the browscap.ini. ------------------------------------------------------------------------ [2003-07-08 16:20:15] mikx at mikx dot de Description: ------------ The object returned from get_browser() function does not contain the platform information as described in the documentation and as usual in prior versions. It's more a missing feature than a bug, but it brings some old scripts relying on this feature into trouble. The browscap.ini is the latest "official" one from Gary Keith. Reproduce code: --------------- $browser = get_browser(); foreach ($browser as $name => $value) { print "<b>$name</b> $value <br />\n"; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24548&edit=1