#24548 [Fbk->Csd]: get_browser() does not return platform
ID: 24548
Updated by: sniper@php.net
Reported By: mikx at mikx dot de
-Status: Feedback
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: *
PHP Version: 4.3.2
Assigned To: jay
New Comment:
Ah..he already committed the fix to the stable branch too.
Case closed.
Previous Comments:
------------------------------------------------------------------------
[2003-07-09 14:17:04] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Jay meant this snapshot, of course. :)
------------------------------------------------------------------------
[2003-07-09 13:53:24] jay@php.net
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
------------------------------------------------------------------------
[2003-07-09 07:33:04] sniper@php.net
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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/24548
--
Edit this bug report at http://bugs.php.net/?id=24548&edit=1
Thread (8 messages)