- Timestamp:
- 10/02/2017 07:39:32 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php
r5986 r5988 38 38 'mobile' => false, 39 39 ); 40 $mobile_device = ''; 40 41 41 42 if ( preg_match( … … 54 55 $data['platform'] = 'Android'; 55 56 } 56 } elseif ( 'Windows Phone' === $data['platform'] ) { 57 } 58 // Normalize Windows Phone OS name when "OS" is omitted. 59 elseif ( 'Windows Phone' === $data['platform'] ) { 57 60 $data['platform'] = 'Windows Phone OS'; 58 61 } 59 60 if ( in_array( $data['platform'], array( 'Android', 'Fire OS', 'iPad', 'iPhone', 'PlayBook', 'RIM Tablet OS', 'Windows Phone OS' ) ) ) { 62 // Generically detect some mobile devices. 63 elseif ( 64 ! $data['platform'] 65 && 66 preg_match( '/BlackBerry|Nokia|SonyEricsson/', $user_agent, $matches ) 67 ) { 68 $data['platform'] = 'Mobile'; 69 $mobile_device = $matches[0]; 70 } 71 72 // Flag known mobile platforms as mobile. 73 if ( in_array( $data['platform'], array( 'Android', 'Fire OS', 'iPad', 'iPhone', 'Mobile', 'PlayBook', 'RIM Tablet OS', 'Windows Phone OS' ) ) ) { 61 74 $data['mobile'] = true; 62 75 } … … 146 159 $data['name'] = 'unknown'; 147 160 $result['version'][ $key ] = ''; 161 $version = ''; 148 162 } 149 163 $data['version'] = $result['version'][ $key ];
Note: See TracChangeset
for help on using the changeset viewer.