Making WordPress.org

Changeset 5974


Ignore:
Timestamp:
09/28/2017 10:31:36 PM (6 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for Microsoft Edge.

Location:
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0
Files:
3 edited

Legend:

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

    r5961 r5974  
    2020        'Chrome'            => '18', // Lowest version at the moment (mobile)
    2121        'Firefox'           => '16',
     22        'Microsoft Edge'    => '15.15063',
    2223        'Opera'             => '12.18',
    2324        'Safari'            => '5',
     
    5960            'img_src'     => $http  . 'ie.png' . "?{$cache_buster}",
    6061            'img_src_ssl' => $https . 'ie.png' . "?{$cache_buster}",
     62        ),
     63        'Edge' => (object) array(
     64            'name'        => 'Microsoft Edge',
     65            'wikipedia'   => 'Microsoft Edge',
     66            'normalized'  => 1, // include second number if non-zero
     67            'url'         => 'https://www.microsoft.com/en-us/windows/microsoft-edge',
     68            'img_src'     => $http  . 'edge.png' . "?{$cache_buster}",
     69            'img_src_ssl' => $https . 'edge.png' . "?{$cache_buster}",
    6170        ),
    6271        'Firefox' => (object) array(
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php

    r5971 r5974  
    5959
    6060    preg_match_all(
    61         '%(?P<name>Opera Mini|Opera|OPR|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|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    6262        $user_agent,
    6363        $result,
     
    8888        $data['version'] = $result['version'][ $key ];
    8989    } elseif ( 'AppleWebKit' == $result['name'][0] ) {
    90         if ( $key = array_search( 'Mobile Safari', $result['name'] ) ) {
     90        if ( $key = array_search( 'Edge', $result['name'] ) ) {
     91            $data['name'] = 'Microsoft Edge';
     92        } elseif ( $key = array_search( 'Mobile Safari', $result['name'] ) ) {
    9193            $data['name'] = 'Mobile Safari';
    9294        // } elseif ( ( 'Android' == $data['platform'] && !($key = 0) ) || $key = array_search( 'Chrome', $result['name'] ) ) {
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r5971 r5974  
    238238            ],
    239239
     240            // Microsoft Edge
     241
     242            [
     243                'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240',
     244                'Windows Microsoft Edge 12.10240',
     245            ],
     246            [
     247                'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586',
     248                'Windows Microsoft Edge 13.10586',
     249            ],
     250            [
     251                'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393',
     252                'Windows Microsoft Edge 14.14393',
     253            ],
     254            [
     255                'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063',
     256                'Windows Microsoft Edge 15.15063'
     257            ],
     258            [
     259                'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 640 LTE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586',
     260                'Windows Phone OS Microsoft Edge 13.10586',
     261            ],
     262            [
     263                'Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Mobile Safari/537.36 Edge/14.14393',
     264                'Windows Phone OS Microsoft Edge 14.14393',
     265            ],
     266            [
     267                'Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15063',
     268                'Windows Phone OS Microsoft Edge 15.15063',
     269            ],
     270
    240271            // Opera
    241272
Note: See TracChangeset for help on using the changeset viewer.