| @@ 1062-1077 (lines=16) @@ | ||
| 1059 | /** |
|
| 1060 | * The is_webkit() method can be used to check the User Agent for an webkit generic browser. |
|
| 1061 | */ |
|
| 1062 | public static function is_webkit() { |
|
| 1063 | ||
| 1064 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1065 | return false; |
|
| 1066 | } |
|
| 1067 | ||
| 1068 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
| 1069 | ||
| 1070 | $pos_webkit = strpos( $agent, 'webkit' ); |
|
| 1071 | ||
| 1072 | if ( false !== $pos_webkit ) { |
|
| 1073 | return true; |
|
| 1074 | } else { |
|
| 1075 | return false; |
|
| 1076 | } |
|
| 1077 | } |
|
| 1078 | ||
| 1079 | /** |
|
| 1080 | * Detects if the current browser is the Native Android browser. |
|
| @@ 1160-1171 (lines=12) @@ | ||
| 1157 | * |
|
| 1158 | * @return boolean true if the browser is Kindle monochrome Native browser otherwise false |
|
| 1159 | */ |
|
| 1160 | public static function is_kindle_touch() { |
|
| 1161 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1162 | return false; |
|
| 1163 | } |
|
| 1164 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
| 1165 | $pos_kindle_touch = strpos( $agent, 'kindle/3.0+' ); |
|
| 1166 | if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) { |
|
| 1167 | return true; |
|
| 1168 | } else { |
|
| 1169 | return false; |
|
| 1170 | } |
|
| 1171 | } |
|
| 1172 | ||
| 1173 | /** |
|
| 1174 | * Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
|
| @@ 1176-1188 (lines=13) @@ | ||
| 1173 | /** |
|
| 1174 | * Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
|
| 1175 | */ |
|
| 1176 | public static function is_windows8_auth() { |
|
| 1177 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1178 | return false; |
|
| 1179 | } |
|
| 1180 | ||
| 1181 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
| 1182 | $pos = strpos( $agent, 'msauthhost' ); |
|
| 1183 | if ( false !== $pos ) { |
|
| 1184 | return true; |
|
| 1185 | } else { |
|
| 1186 | return false; |
|
| 1187 | } |
|
| 1188 | } |
|
| 1189 | ||
| 1190 | /** |
|
| 1191 | * Detect if user agent is the WordPress.com Windows 8 app. |
|
| @@ 1193-1205 (lines=13) @@ | ||
| 1190 | /** |
|
| 1191 | * Detect if user agent is the WordPress.com Windows 8 app. |
|
| 1192 | */ |
|
| 1193 | public static function is_wordpress_for_win8() { |
|
| 1194 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1195 | return false; |
|
| 1196 | } |
|
| 1197 | ||
| 1198 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
| 1199 | $pos = strpos( $agent, 'wp-windows8' ); |
|
| 1200 | if ( false !== $pos ) { |
|
| 1201 | return true; |
|
| 1202 | } else { |
|
| 1203 | return false; |
|
| 1204 | } |
|
| 1205 | } |
|
| 1206 | ||
| 1207 | /** |
|
| 1208 | * Detect if user agent is the WordPress.com Desktop app. |
|
| @@ 1210-1222 (lines=13) @@ | ||
| 1207 | /** |
|
| 1208 | * Detect if user agent is the WordPress.com Desktop app. |
|
| 1209 | */ |
|
| 1210 | public static function is_wordpress_desktop_app() { |
|
| 1211 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1212 | return false; |
|
| 1213 | } |
|
| 1214 | ||
| 1215 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
| 1216 | $pos = strpos( $agent, 'WordPressDesktop' ); |
|
| 1217 | if ( false !== $pos ) { |
|
| 1218 | return true; |
|
| 1219 | } else { |
|
| 1220 | return false; |
|
| 1221 | } |
|
| 1222 | } |
|
| 1223 | ||
| 1224 | /** |
|
| 1225 | * The is_blackberry_tablet() method can be used to check the User Agent for a RIM blackberry tablet. |
|