Changeset 5971
- Timestamp:
- 09/28/2017 04:30:41 PM (7 years ago)
- 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
r5967 r5971 40 40 41 41 if ( preg_match( 42 '/^.+?(?P<platform> Android|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|RIM Tablet OS|PlayBook)(?: (NT|zvav))*(?: [ix]?[0-9._]+)*(;|\))/im',42 '/^.+?(?P<platform>Windows Phone( OS)?|Android|iPhone|iPad|Windows|Linux|Macintosh|RIM Tablet OS|PlayBook)(?: (NT|zvav))*(?: [ix]?[0-9._]+)*(;|\))/im', 43 43 $user_agent, 44 44 $regs … … 50 50 if ( 'Linux' === $data['platform'] && false !== strpos( $user_agent, 'Android' ) ) { 51 51 $data['platform'] = 'Android'; 52 } elseif ( 'Windows Phone' === $data['platform'] ) { 53 $data['platform'] = 'Windows Phone OS'; 52 54 } 53 55 … … 116 118 // IE 11 and beyond have switched to Trident 117 119 // http://msdn.microsoft.com/en-us/library/ie/hh869301%28v=vs.85%29.aspx 118 $data['name'] = 'Internet Explorer'; 119 if( '7.0' == $result['version'][0] ) { 120 if ( $key = array_search( 'IEMobile', $result['name'] ) ) { 121 $data['name'] = 'Internet Explorer Mobile'; 122 } else { 123 $data['name'] = 'Internet Explorer'; 124 } 125 if ( '7.0' == $result['version'][0] ) { 120 126 $data['version'] = '11'; 121 127 } -
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php
r5970 r5971 220 220 'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) LG;LG-E900h)', 221 221 'Windows Phone OS Internet Explorer Mobile 7.0', 222 ], 223 [ 224 'Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 710)', 225 'Windows Phone OS Internet Explorer Mobile 9.0', 226 ], 227 [ 228 'Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)', 229 'Windows Phone OS Internet Explorer Mobile 10.0', 230 ], 231 [ 232 'Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Lumia 435) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537', 233 'Windows Phone OS Internet Explorer Mobile 11', 234 ], 235 [ 236 'Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 520) like Gecko', 237 'Windows Phone OS Internet Explorer Mobile 11', 222 238 ], 223 239
Note: See TracChangeset
for help on using the changeset viewer.