Skip to content

Commit

Permalink
Small Windows Phone improvments.
Browse files Browse the repository at this point in the history
  • Loading branch information
donatj committed Apr 23, 2015
1 parent f410570 commit 4d52dd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/UserAgentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function parse_user_agent( $u_agent = null ) {
(?:\ [^;]*)?
(?:;|$)/imx', $parent_matches[1], $result, PREG_PATTERN_ORDER);

$priority = array( 'Android', 'Xbox One', 'Xbox', 'Tizen' );
$priority = array( 'Xbox One', 'Xbox', 'Windows Phone', 'Tizen', 'Android' );
$result['platform'] = array_unique($result['platform']);
if( count($result['platform']) > 1 ) {
if( $keys = array_intersect($priority, $result['platform']) ) {
Expand Down
5 changes: 5 additions & 0 deletions Tests/user_agents.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@
"browser": "IEMobile",
"version": "10.0"
},
"Mozilla\/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident\/7.0; Touch; rv:11.0; IEMobile\/11.0; NOKIA; Lumia 920; Vodafone ES) like iPhone OS 7_0_3 Mac OS X AppleWebkit\/537 (KHTML, like Gecko) Mobile Safari\/537": {
"platform": "Windows Phone",
"browser": "IEMobile",
"version": "11.0"
},
"Mozilla\/5.0 (Windows Phone 8.1; ARM; Trident\/7.0;Touch; rv:11.0; IEMobile\/11.0; Microsoft; Virtual) like Gecko": {
"platform": "Windows Phone",
"browser": "IEMobile",
Expand Down

0 comments on commit 4d52dd8

Please sign in to comment.