php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35710 get_browser returns false
Submitted: 2005-12-16 16:25 UTC Modified: 2005-12-16 17:49 UTC
From: mike at blueroot dot co dot uk Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.1 OS: Linux
Private report: No CVE-ID: None
 [2005-12-16 16:25 UTC] mike at blueroot dot co dot uk
Description:
------------
get_browser() returns false when given valid parameters.  browscap.ini is the latest downloaded from http://www.garykeith.com/browsers/downloads.asp

browscap is set correctly in php.ini and shows in phpinfo()

Reproduce code:
---------------
echo count(file(ini_get('browscap')))."<br><br>";

$browser = get_browser('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3', true);

var_dump($browser);

The first line shows that the browscap.ini file is being read properly

# wc -l /php5/lib/browscap.ini
14296 /php5/lib/browscap.ini


Expected result:
----------------
14296

Array
(
    [browser_name_regex] => ^mozilla/5\.0 (windows; .; windows nt 5\.1; .*rv:.*) gecko/.* firefox/0\.9.*$
    [browser_name_pattern] => Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/0.9*
    [parent] => Firefox 0.9
    [platform] => WinXP
    [browser] => Firefox
    [version] => 0.9
    [majorver] => 0
    [minorver] => 9
    [css] => 2
    [frames] => 1
    [iframes] => 1
    [tables] => 1
    [cookies] => 1
    [backgroundsounds] => 
    [vbscript] => 
    [javascript] => 1
    [javaapplets] => 1
    [activexcontrols] => 
    [cdf] => 
    [aol] => 
    [beta] => 1
    [win16] => 
    [crawler] => 
    [stripper] => 
    [wap] => 
    [netclr] => 
)

Actual result:
--------------
14296

bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 16:33 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.


 [2005-12-16 17:49 UTC] sniper@php.net
I meant bug #27372 which is the root issue.

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 07:00:02 2026 UTC