WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/02/2017 07:47:55 PM (2 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add support for UC Browser.

File:
1 edited

Legend:

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

    r5989 r5991  
    7676
    7777    preg_match_all(
    78         '%(?P<name>Opera Mini|Opera|OPR|Edge|Trident|Silk|Camino|Kindle|Firefox|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
     78        '%(?P<name>Opera Mini|Opera|OPR|Edge|UCBrowser|UCWEB|Trident|Silk|Camino|Kindle|Firefox|(?:Mobile )?Safari|NokiaBrowser|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Version)(?:[/ ])(?P<version>[0-9.]+)%im',
    7979        $user_agent,
    8080        $result,
     
    112112        }
    113113        $data['version'] = $result['version'][ $key ];
     114    }
     115    // UC Browser
     116    elseif (
     117        false !== ( $key = array_search( 'UCBrowser', $result['name'] ) )
     118    ||
     119        false !== ( $key = array_search( 'UCWEB', $result['name'] ) )
     120    ) {
     121        $data['name']     = 'UC Browser';
     122        $data['version']  = $result['version'][ $key ];
     123        $version          = '';
    114124    }
    115125    // Nokia Browser
Note: See TracChangeset for help on using the changeset viewer.