WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/11/17 18:46:15 (2 months ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for Chromium.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php

    r6020 r6021  
    4242    // Identify platform/OS in user-agent string. 
    4343    if ( preg_match( 
    44         '/^.+?(?P<platform>Windows Phone( OS)?|Symbian|SymbOS|Android|iPhone|iPad|Windows|Linux|Macintosh|FreeBSD|OpenBSD|SunOS|RIM Tablet OS|PlayBook)(?: (NT|zvav))*(?: [ix]?[0-9._]+(\-[0-9a-z\.\-]+)?)*(;|\))/im', 
     44        '/^.+?(?P<platform>Windows Phone( OS)?|Symbian|SymbOS|Android|iPhone|iPad|Windows|Linux|Macintosh|FreeBSD|OpenBSD|SunOS|RIM Tablet OS|PlayBook)(?: (NT|amd64|armv7l|zvav))*(?: [ix]?[0-9._]+(\-[0-9a-z\.\-]+)?)*(;|\))/im', 
    4545        $user_agent, 
    4646        $regs 
     
    5151    // Find tokens of interest in user-agent string. 
    5252    preg_match_all( 
    53         '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|QQBrowser|SymbianOS|Symbian|S40OviBrowser|Trident|Silk|Konqueror|PaleMoon|Puffin|SeaMonkey|Vivaldi|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im', 
     53        '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|QQBrowser|SymbianOS|Symbian|S40OviBrowser|Trident|Silk|Konqueror|PaleMoon|Puffin|SeaMonkey|Vivaldi|Camino|Chromium|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im', 
    5454        $user_agent, 
    5555        $result, 
     
    165165    elseif ( false !== ( $key = array_search( 'SamsungBrowser', $result['name'] ) ) ) { 
    166166        $data['name']     = 'Samsung Browser'; 
     167        $data['version']  = $result['version'][ $key ]; 
     168    } 
     169    // Chromium 
     170    elseif ( false !== ( $key = array_search( 'Chromium', $result['name'] ) ) ) { 
     171        $data['name']     = 'Chromium'; 
    167172        $data['version']  = $result['version'][ $key ]; 
    168173    } 
Note: See TracChangeset for help on using the changeset viewer.