summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/class.jetpack-user-agent.php')
-rw-r--r--plugins/jetpack/class.jetpack-user-agent.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/plugins/jetpack/class.jetpack-user-agent.php b/plugins/jetpack/class.jetpack-user-agent.php
index d3324051..dba40260 100644
--- a/plugins/jetpack/class.jetpack-user-agent.php
+++ b/plugins/jetpack/class.jetpack-user-agent.php
@@ -10,6 +10,10 @@ function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) || strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ), 'ipad' ) )
return false;
+ // Remove Samsung Galaxy tablets (SCH-I800) from being mobile devices
+ if ( strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ) , 'sch-i800') )
+ return false;
+
if( $ua_info->is_android_tablet() && $ua_info->is_kindle_touch() === false )
return false;
@@ -164,6 +168,8 @@ class Jetpack_User_Agent_Info {
return 'iphone-unknown';
elseif ( $this->is_ipad( 'ipad-not-safari' ) )
return 'ipad-unknown';
+ elseif ( $this->is_Nintendo_3DS() )
+ return 'nintendo-3ds';
else {
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
$dumb_agents = $this->dumb_agents;
@@ -339,6 +345,12 @@ class Jetpack_User_Agent_Info {
$this->isTierRichCss = false;
$this->isTierGenericMobile = false;
}
+ elseif ( $this->is_Nintendo_3DS() ) {
+ $this->matched_agent = 'nintendo-3ds';
+ $this->isTierIphone = true;
+ $this->isTierRichCss = false;
+ $this->isTierGenericMobile = false;
+ }
else {
$this->isTierIphone = false;
}
@@ -654,6 +666,7 @@ class Jetpack_User_Agent_Info {
* The rendering engine is on Opera's server.)
*
* Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00"
+ * Opera/9.50 (Nintendo DSi; Opera/507; U; en-US)
*/
static function is_opera_mobile( ) {
@@ -664,6 +677,8 @@ class Jetpack_User_Agent_Info {
if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false )
return true;
+ elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false )
+ return true;
else
return false;
}
@@ -1326,6 +1341,24 @@ class Jetpack_User_Agent_Info {
return false;
}
+ /*
+ * Detects if the current browser is Nintendo 3DS handheld.
+ *
+ * example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US
+ * can differ in language, version and region
+ */
+ static function is_Nintendo_3DS() {
+ if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
+ return false;
+ }
+
+ $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
+ if ( strpos( $ua, 'nintendo 3ds' ) !== false ) {
+ return true;
+ }
+ return false;
+ }
+
/**
* Was the current request made by a known bot?
*
@@ -1357,7 +1390,7 @@ class Jetpack_User_Agent_Info {
'alexa', 'altavista', 'ask jeeves', 'attentio', 'baiduspider', 'bingbot', 'chtml generic', 'crawler', 'fastmobilecrawl',
'feedfetcher-google', 'firefly', 'froogle', 'gigabot', 'googlebot', 'googlebot-mobile', 'heritrix', 'ia_archiver', 'irlbot',
'infoseek', 'jumpbot', 'lycos', 'mediapartners', 'mediobot', 'motionbot', 'msnbot', 'mshots', 'openbot',
- 'pss-webkit-request', // See http://systemsrequests.wordpress.com/2013/07/30/log-request-to-help-us-with-this-issue
+ 'pss-webkit-request',
'pythumbnail', 'scooter', 'slurp', 'snapbot', 'spider', 'taptubot', 'technoratisnoop',
'teoma', 'twiceler', 'yahooseeker', 'yahooysmcm', 'yammybot',
);