Returns platform as "unknown" despite get_browser() returning correctly

Created on 9 May 2017, over 7 years ago
Updated 1 March 2024, 11 months ago

I am using 8.x-3.x-dev and as of today have browscap version 6023. This might be a support request :D.

This is the output from $this->browscap->getBrowser():

Array
(
    [comment] => Default Browser
    [browser] => Default Browser
    [browser_maker] => unknown
    [version] => 0.0
    [majorver] => 0
    [minorver] => 0
    [platform] => unknown
    [ismobiledevice] => 0
    [istablet] => 0
    [crawler] => 0
    [device_type] => unknown
    [device_pointing_method] => unknown
    [parent] => DefaultProperties
    [useragent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
    [browser_name_pattern] => *
)

Here is the output from var_dump(get_browser()):

object(stdClass)[896]
  public 'browser_name_regex' => string '~^mozilla/5\.0 \(.*mac os x 10.12.*\) applewebkit.* \(.*khtml.*like.*gecko.*\) chrome/57\..*safari/.*$~' (length=103)
  public 'browser_name_pattern' => string 'Mozilla/5.0 (*Mac OS X 10?12*) applewebkit* (*khtml*like*gecko*) Chrome/57.*Safari/*' (length=84)
  public 'parent' => string 'Chrome 57.0' (length=11)
  public 'platform' => string 'macOS' (length=5)
  public 'comment' => string 'Chrome 57.0' (length=11)
  public 'browser' => string 'Chrome' (length=6)
  public 'browser_maker' => string 'Google Inc' (length=10)
  public 'version' => string '57.0' (length=4)
  public 'majorver' => string '57' (length=2)
  public 'device_type' => string 'Desktop' (length=7)
  public 'device_pointing_method' => string 'mouse' (length=5)
  public 'minorver' => string '0' (length=1)
  public 'ismobiledevice' => string '' (length=0)
  public 'istablet' => string '' (length=0)
  public 'crawler' => string '' (length=0)

I have copy/pasted the result of $this->browscap->getBrowser()['useragent'] directly into http://browscap.org/ua-lookup and it returns the correct information (platform is 'macOS').

πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States chrisrockwell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024