]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add a User-Agent fragment blacklist to MobileProfile: sticking iPad on the regular...
authorBrion Vibber <brion@pobox.com>
Tue, 6 Apr 2010 19:21:42 +0000 (12:21 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 6 Apr 2010 19:21:42 +0000 (12:21 -0700)
plugins/MobileProfile/MobileProfilePlugin.php

index a104eadd7be37e323f0988de676f73c149087a22..60bb3b68fa3c968aa56c57571ca684c264d26976 100644 (file)
@@ -141,8 +141,19 @@ class MobileProfilePlugin extends WAP20Plugin
                     'windows ce'
                 );
 
+                $blacklist = array(
+                    'ipad', // Larger screen handles the full theme fairly well.
+                );
+
                 $httpuseragent = strtolower($_SERVER['HTTP_USER_AGENT']);
 
+                foreach ($blacklist as $md) {
+                    if (strstr($httpuseragent, $md) !== false) {
+                        $this->serveMobile = false;
+                        return true;
+                    }
+                }
+
                 foreach ($this->mobiledevices as $md) {
                     if (strstr($httpuseragent, $md) !== false) {
                         $this->setMobileFeatures($httpuseragent);