WordPress.org

Making WordPress.org

Changeset 5979


Ignore:
Timestamp:
09/29/2017 06:47:11 PM (22 months ago)
Author:
coffee2code
Message:

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

    r5977 r5979  
    5959
    6060    preg_match_all(
    61         '%(?P<name>Opera Mini|Opera|OPR|Edge|Trident|Camino|Kindle|Firefox|(?:Mobile )?Safari|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
     61        '%(?P<name>Opera Mini|Opera|OPR|Edge|Trident|Camino|Kindle|Firefox|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    6262        $user_agent,
    6363        $result,
     
    8787        }
    8888        $data['version'] = $result['version'][ $key ];
     89    }
     90    // Nokia Browser
     91    elseif ( $key = array_search( 'NokiaBrowser', $result['name'] ) ) {
     92        $data['name']     = 'Nokia Browser';
     93        $data['version']  = $result['version'][ $key ];
     94        $data['mobile']   = true;
    8995    } elseif ( 'AppleWebKit' == $result['name'][0] ) {
    9096        if ( $key = array_search( 'Edge', $result['name'] ) ) {
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r5977 r5979  
    287287            ],
    288288
     289            // Nokia Browser
     290
     291            [
     292                'Mozilla/5.0 (Linux; Android 4.1.2; Nokia_X Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.82 Mobile Safari/537.36 NokiaBrowser/1.2.0.12',
     293                'Android Nokia Browser 1.2.0.12',
     294            ],
     295            [
     296                'Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13',
     297                'Mobile Nokia Browser 8.5.0',
     298            ],
     299
    289300            // Opera
    290301
Note: See TracChangeset for help on using the changeset viewer.