#47725 [Opn->Csd]: get_browser incorrectly matches browscap.ini
ID: 47725
Updated by: kalle@php.net
Reported By: prakash dot ved dot v at gmail dot com
-Status: Open
+Status: Closed
Bug Type: *General Issues
Operating System: Linux, Windows
PHP Version: 5.2.9
New Comment:
This is not really an issue in php but in the php_browscap.ini file,
the regex for Sleipnir is "Sleipnir*", not if its "cloaked" as IE.
Try contact the maintainer about the bug at:
http://browsers.garykeith.com/contact-me.asp
Previous Comments:
------------------------------------------------------------------------
[2009-03-20 07:00:58] prakash dot ved dot v at gmail dot com
Description:
------------
PHP get_browser function seems to not have proper pattern match for
Sleipnir browser. passing the UA string to the function returns
incorrect information. This happens across all the platforms and all the
versions, this also includes 5.2.9-1.
Reproduce code:
---------------
<?php
$browser = get_browser("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Sleipnir/2.8.4",false);
print_r($browser);
?>
Expected result:
----------------
These are the expected values for the following object members
[parent]=>Sleipnir 2.8.4
[version]=>2.8.4
[minorver]=>2
[browser]=>Sleipnir
Actual result:
--------------
stdClass Object
(
[browser_name_regex] => ^mozilla/4\.0 (compatible; msie 7\.0;
.*windows nt 5\.1.*).*$
[browser_name_pattern] => Mozilla/4.0 (compatible; MSIE 7.0;
*Windows NT 5.1*)*
[parent] => IE 7.0
[platform] => WinXP
[browser] => IE
[version] => 7.0
[majorver] => 7
[win32] => 1
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] => 1
[cdf] => 1
[vbscript] => 1
[javaapplets] => 1
[javascript] => 1
[activexcontrols] => 1
[cssversion] => 2
[supportscss] => 1
[minorver] => 0
[alpha] =>
[beta] =>
[win16] =>
[win64] =>
[isbanned] =>
[ismobiledevice] =>
[issyndicationreader] =>
[crawler] =>
[aol] =>
[aolversion] => 0
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47725&edit=1
Thread (3 messages)