Making WordPress.org

Changeset 5994


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

Browse Happy API: Add support for Samsung Browser.

Location:
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0
Files:
2 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    }
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r5991 r5994  
    509509            ],
    510510
     511            // Samsung Browser
     512
     513            [
     514                'Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G360T1 Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Mobile Safari/537.36',
     515                'Android Samsung Browser 3.3',
     516            ],
     517            [
     518                'Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.4 Chrome/51.0.2704.106 Mobile Safari/537.36',
     519                'Android Samsung Browser 5.4',
     520            ],
     521            [
     522                'Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1',
     523                'Linux Samsung Browser 1.1',
     524            ],
     525
    511526            // UC Browser
    512527
Note: See TracChangeset for help on using the changeset viewer.