php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47725 get_browser incorrectly matches browscap.ini
Submitted: 2009-03-20 07:00 UTC Modified: 2009-03-20 18:48 UTC
From: prakash dot ved dot v at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.9 OS: Linux, Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: prakash dot ved dot v at gmail dot com
New email:
PHP Version: OS:

 

 [2009-03-20 07:00 UTC] 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
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-20 18:43 UTC] kalle@php.net
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

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 13:01:31 2025 UTC