Making WordPress.org

Changeset 6018


Ignore:
Timestamp:
10/11/2017 03:54:53 PM (7 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for SeaMonkey.

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

    r6017 r6018  
    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|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|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    5454        $user_agent,
    5555        $result,
     
    179179    elseif ( false !== ( $key = array_search( 'PaleMoon', $result['name'] ) ) ) {
    180180        $data['name']     = 'Pale Moon';
     181        $data['version']  = $result['version'][ $key ];
     182    }
     183    // SeaMonkey
     184    elseif ( false !== ( $key = array_search( 'SeaMonkey', $result['name'] ) ) ) {
     185        $data['name']     = 'SeaMonkey';
    181186        $data['version']  = $result['version'][ $key ];
    182187    }
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r6017 r6018  
    624624            ],
    625625
     626            // SeaMonkey
     627
     628            [
     629                'Mozilla/5.0 (X11; FreeBSD i386; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40',
     630                'FreeBSD SeaMonkey 2.40',
     631            ],
     632            [
     633                'Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46',
     634                'Linux SeaMonkey 2.46',
     635            ],
     636            [
     637                'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40',
     638                'Macintosh SeaMonkey 2.40',
     639            ],
     640            [
     641                'Mozilla/5.0 (X11; OpenBSD i386; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1',
     642                'OpenBSD SeaMonkey 2.33.1',
     643            ],
     644            [
     645                'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40',
     646                'Windows SeaMonkey 2.40',
     647            ],
     648
    626649            // UC Browser
    627650
Note: See TracChangeset for help on using the changeset viewer.