|
@@ 1157-1172 (lines=16) @@
|
| 1154 |
|
/* |
| 1155 |
|
is_webkit() can be used to check the User Agent for an webkit generic browser |
| 1156 |
|
*/ |
| 1157 |
|
static function is_webkit() { |
| 1158 |
|
|
| 1159 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 1160 |
|
return false; |
| 1161 |
|
} |
| 1162 |
|
|
| 1163 |
|
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 1164 |
|
|
| 1165 |
|
$pos_webkit = strpos( $agent, 'webkit' ); |
| 1166 |
|
|
| 1167 |
|
if ( $pos_webkit !== false ) { |
| 1168 |
|
return true; |
| 1169 |
|
} else { |
| 1170 |
|
return false; |
| 1171 |
|
} |
| 1172 |
|
} |
| 1173 |
|
|
| 1174 |
|
/** |
| 1175 |
|
* Detects if the current browser is the Native Android browser. |
|
@@ 1257-1268 (lines=12) @@
|
| 1254 |
|
* |
| 1255 |
|
* @return boolean true if the browser is Kindle monochrome Native browser otherwise false |
| 1256 |
|
*/ |
| 1257 |
|
static function is_kindle_touch() { |
| 1258 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 1259 |
|
return false; |
| 1260 |
|
} |
| 1261 |
|
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 1262 |
|
$pos_kindle_touch = strpos( $agent, 'kindle/3.0+' ); |
| 1263 |
|
if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) { |
| 1264 |
|
return true; |
| 1265 |
|
} else { |
| 1266 |
|
return false; |
| 1267 |
|
} |
| 1268 |
|
} |
| 1269 |
|
|
| 1270 |
|
|
| 1271 |
|
// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
|
@@ 1272-1284 (lines=13) @@
|
| 1269 |
|
|
| 1270 |
|
|
| 1271 |
|
// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
| 1272 |
|
static function is_windows8_auth() { |
| 1273 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 1274 |
|
return false; |
| 1275 |
|
} |
| 1276 |
|
|
| 1277 |
|
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 1278 |
|
$pos = strpos( $agent, 'msauthhost' ); |
| 1279 |
|
if ( false !== $pos ) { |
| 1280 |
|
return true; |
| 1281 |
|
} else { |
| 1282 |
|
return false; |
| 1283 |
|
} |
| 1284 |
|
} |
| 1285 |
|
|
| 1286 |
|
// Detect if user agent is the WordPress.com Windows 8 app. |
| 1287 |
|
static function is_wordpress_for_win8() { |
|
@@ 1287-1299 (lines=13) @@
|
| 1284 |
|
} |
| 1285 |
|
|
| 1286 |
|
// Detect if user agent is the WordPress.com Windows 8 app. |
| 1287 |
|
static function is_wordpress_for_win8() { |
| 1288 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 1289 |
|
return false; |
| 1290 |
|
} |
| 1291 |
|
|
| 1292 |
|
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 1293 |
|
$pos = strpos( $agent, 'wp-windows8' ); |
| 1294 |
|
if ( false !== $pos ) { |
| 1295 |
|
return true; |
| 1296 |
|
} else { |
| 1297 |
|
return false; |
| 1298 |
|
} |
| 1299 |
|
} |
| 1300 |
|
|
| 1301 |
|
|
| 1302 |
|
// Detect if user agent is the WordPress.com Desktop app. |