browser_detection_php_ar.txt 5.3.17 wrong browser version for Chrome
amereservant
Status: New User - Welcome
Joined: 30 Aug 2011
Posts: 1
Reply Quote
The browser number for Chrome in Linux Ubuntu is wrong in the browser detection.
It's detecting it as 534.30, which it's actually suppose to be 12.0.742.112.

Here's the user agent string:
:: Code ::
Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Ubuntu/11.04 Chromium/12.0.742.112 Chrome/12.0.742.112 Safari/534.30

Here's the output from print_r(browser_detection( 'full_assoc' ));:
:: Code ::

Array
(
    [browser_working] => webkit
    [browser_number] => 534.30
    [ie_version] =>
    [dom] => 1
    [safe] => 1
    [os] => lin
    [os_number] => ubuntu
    [browser_name] => chrome
    [ua_type] => bro
    [browser_math_number] => 534.30
    [moz_data] => Array
        (
            [0] =>
            [1] =>
            [2] =>
            [3] =>
            [4] =>
        )

    [webkit_data] => Array
        (
            [0] => chrome
            [1] => 12.0.742.112
            [2] => 534.30
        )

    [mobile_test] =>
    [mobile_data] =>
    [true_ie_number] =>
    [run_time] => 0.00037098
)


I hope that helps.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Thanks for the excellent issue report.

And especially thanks for printing out the array contents, which shows that everything is working exactly as intended.

The key concept here you appear to be missing is that what the browser detection script is looking for is core functionality, which is why the key id used for both gecko and webkit browsers is the gecko and webkit id numbers, which give the actual engine.

For other uses, you can use the sub version information, which as you can see in your output, is readily available, in this case, the chrome version number.

So the actual data is:
webkit browser, engine 534.30
webkit browser type chrome, version 12.0.742.112

As the top information notes in the explanation of return values:

:: Code ::
17. webkit_data - [deprecated: webkit_version] returns array of webkit data.
    Return Array listed by index number:
      0 - $webkit_type [webkit version name (Eg. chrome)]
      1 - $webkit_type_number [webkit version number (Eg. Chrome's: 1.2)]
      2 - $browser_number [the actual webkit version number (Eg. Webkit's: 436)]


However, with that noted, I do see that there's a missing browser type, chromium in the webkit type array, so i'll add that.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours