WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/02/2017 08:42:19 PM (3 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for Samsung Browser.

File:
1 edited

Legend:

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

    r5991 r5994  
    7676
    7777    preg_match_all(
    78         '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|Trident|Silk|Camino|Kindle|Firefox|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
     78        '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|Trident|Silk|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    7979        $user_agent,
    8080        $result,
     
    138138    elseif ( false !== ( $key = array_search( 'Kindle', $result['name'] ) ) ) {
    139139        $data['name']     = 'Kindle Browser';
     140        $data['version']  = $result['version'][ $key ];
     141    }
     142    // Samsung Browser
     143    elseif ( false !== ( $key = array_search( 'SamsungBrowser', $result['name'] ) ) ) {
     144        $data['name']     = 'Samsung Browser';
    140145        $data['version']  = $result['version'][ $key ];
    141146    }
Note: See TracChangeset for help on using the changeset viewer.