WordPress.org

Making WordPress.org

Changeset 6012


Ignore:
Timestamp:
10/09/2017 05:36:45 PM (2 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for Pale Moon.

See https://github.com/WordPress/browsehappy/issues/42

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

    r6011 r6012  
    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|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|PaleMoon|Camino|Kindle|Firefox|SamsungBrowser|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    5454        $user_agent,
    5555        $result,
     
    165165    elseif ( false !== ( $key = array_search( 'SamsungBrowser', $result['name'] ) ) ) {
    166166        $data['name']     = 'Samsung Browser';
     167        $data['version']  = $result['version'][ $key ];
     168    }
     169    // Pale Moon
     170    elseif ( false !== ( $key = array_search( 'PaleMoon', $result['name'] ) ) ) {
     171        $data['name']     = 'Pale Moon';
    167172        $data['version']  = $result['version'][ $key ];
    168173    }
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php

    r6011 r6012  
    473473            ],
    474474
     475            // Pale Moon
     476
     477            [
     478                'Mozilla/5.0 (X11; Linux x86_64; rv:2.1) Gecko/20100101 Goanna/20160701 PaleMoon/26.3.3',
     479                'Linux Pale Moon 26.3.3',
     480            ],
     481            [
     482                'Mozilla/5.0 (X11; Linux x86_64; rv:38.9) Gecko/20100101 Goanna/2.2 Firefox/38.9 PaleMoon/26.5.0',
     483                'Linux Pale Moon 26.5.0',
     484            ],
     485            [
     486                'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:38.9) Gecko/20100101 Goanna/2.1 Firefox/38.9 PaleMoon/26.3.3',
     487                'Windows Pale Moon 26.3.3',
     488            ],
     489            [
     490                'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.9) Gecko/20100101 Goanna/3.2 Firefox/45.9 PaleMoon/27.3.0',
     491                'Windows Pale Moon 27.3.0',
     492            ],
     493
    475494            // QQ Browser
    476495
Note: See TracChangeset for help on using the changeset viewer.