From:             [EMAIL PROTECTED]
Operating system: Redhat 8.0
PHP version:      4.3.0-pre2
PHP Bug Type:     Unknown/Other Function
Bug description:  get_browser() does not correct parse browscap.ini

hello,

i tried different browser with get_browsers, and had a lot of trouble.
for me, it seems that get_browser() does not recognize the question mark
'?' as joker sign if there is no asterisk '*'.

testet browsers (on a win2000):
ie 5 ok
mozilla 1.x, netscape 6/7, opera 6.2/7b not work

sample script:
    $ua = "Mozilla/5.0 (Windows; ?; Windows NT 5.0; ??-??; rv:1.1)
Gecko/????????";
    print "<b>user_agent exact as written in browscap.ini:</b> [$ua]<br
/>";
    fPrintBrowser( get_browser($ua) ) ;
    $ua= $_SERVER["HTTP_USER_AGENT"];
    print "<b>user_agent as it browser sends:</b> [$ua]<br />";
    fPrintBrowser( get_browser($ua) ) ;

    function fPrintBrowser($browser) {
        print "<b>pattern: </b>" . $browser->browser_name_pattern ."<br
/>";
        print "<b>browser: </b>" . $browser->browser ."<br />";
    }

sample output:
    user_agent exact as written in browscap.ini: [Mozilla/5.0 (Windows; ?;
Windows NT 5.0; ??-??; rv:1.1) Gecko/????????]
    pattern: Mozilla/5\.0 (Windows; .; Windows NT 5\.0; ..-..; rv:1\.1)
Gecko/........
    browser: Mozilla

    user_agent as it browser sends: [Mozilla/5.0 (Windows; U; Windows NT
5.0; en-US; rv:1.1) Gecko/20020826]
    pattern: .*
    browser: Default

browscap.ini from http://www.garykeith.com/ (November 13, 2002):
entry (line 5522) don't work:
[Mozilla/5.0 (Windows; ?; Windows NT 5.0; ??-??; rv:1.1) Gecko/????????]

modified entry which works (asterisk at the end):
[Mozilla/5.0 (Windows; ?; Windows NT 5.0; ??-??; rv:1.1) Gecko/????????*]

thanks!
markus
-- 
Edit bug report at http://bugs.php.net/?id=20462&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20462&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20462&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20462&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20462&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20462&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20462&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20462&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20462&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20462&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20462&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20462&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20462&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20462&r=isapi

Reply via email to