WordPress.org

Making WordPress.org

Changeset 5995


Ignore:
Timestamp:
10/02/2017 08:43:04 PM (22 months ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for QQ 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

    r5994 r5995  
    7676
    7777    preg_match_all(
    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',
     78        '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|QQBrowser|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,
     
    120120    ) {
    121121        $data['name']     = 'UC Browser';
     122        $data['version']  = $result['version'][ $key ];
     123        $version          = '';
     124    }
     125    // QQ Browser
     126    elseif ( false !== ( $key = array_search( 'QQBrowser', $result['name'] ) ) ) {
     127        $data['name']     = 'QQ Browser';
    122128        $data['version']  = $result['version'][ $key ];
    123129        $version          = '';
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r5994 r5995  
    446446            ],
    447447
     448            // QQ Browser
     449
     450            [
     451                'MQQBrowser/2.0,Nokia6681/2.0',
     452                'Mobile QQ Browser 2.0',
     453            ],
     454            [
     455                'Mozilla/5.0 (Linux; U; Android 4.4.2; zh-cn; GT-I9500 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.0 QQ-URL-Manager Mobile Safari/537.36',
     456                'Android QQ Browser 5.0',
     457            ],
     458            [
     459                'Mozilla/5.0 (Linux; U; Android 4.3; zh-cn; SM-T2556 Build/JLS36C) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/6.9 Mobile Safari/537.36',
     460                'Android QQ Browser 6.9',
     461            ],
     462            [
     463                'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; QQBrowser/6.12)',
     464                'Windows QQ Browser 6.12',
     465            ],
     466            [
     467                'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.3226.400 QQBrowser/9.6.11681.400',
     468                'Windows QQ Browser 9.6.11681.400',
     469            ],
     470
    448471            // Safari
    449472
Note: See TracChangeset for help on using the changeset viewer.