WordPress.org

Making WordPress.org

Changeset 6019


Ignore:
Timestamp:
10/11/2017 03:55:33 PM (2 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for Vivaldi.

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

    r6018 r6019  
    5151    // Find tokens of interest in user-agent string.
    5252    preg_match_all(
    53         '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|QQBrowser|SymbianOS|Symbian|S40OviBrowser|Trident|Silk|Konqueror|PaleMoon|SeaMonkey|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
     53        '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|QQBrowser|SymbianOS|Symbian|S40OviBrowser|Trident|Silk|Konqueror|PaleMoon|SeaMonkey|Vivaldi|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    5454        $user_agent,
    5555        $result,
     
    184184    elseif ( false !== ( $key = array_search( 'SeaMonkey', $result['name'] ) ) ) {
    185185        $data['name']     = 'SeaMonkey';
     186        $data['version']  = $result['version'][ $key ];
     187    }
     188    // Vivaldi
     189    elseif ( false !== ( $key = array_search( 'Vivaldi', $result['name'] ) ) ) {
     190        $data['name']     = 'Vivaldi';
    186191        $data['version']  = $result['version'][ $key ];
    187192    }
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r6018 r6019  
    678678            ],
    679679
     680            // Vivaldi
     681
     682            [
     683                'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43',
     684                'Linux Vivaldi 1.2.490.43',
     685            ],
     686            [
     687                'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.98 Safari/537.36 Vivaldi/1.6.689.40',
     688                'Macintosh Vivaldi 1.6.689.40',
     689            ],
     690            [
     691                'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.98 Safari/537.36 Vivaldi/1.6.689.40',
     692                'Windows Vivaldi 1.6.689.40',
     693            ],
     694
    680695            // Miscellaneous
    681696
Note: See TracChangeset for help on using the changeset viewer.