diff options
author | Brion Vibber <brion@pobox.com> | 2010-04-06 12:21:42 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-04-06 12:21:42 -0700 |
commit | 3172b50fc7eec9a2ae2b27abe5e9ab3e0875558c (patch) | |
tree | be6b106df75a3775e92aed3a6ea8a296a39ed1f6 /plugins | |
parent | edea825c70c2adb550e4fb47a94c497e0e92f0ad (diff) |
Add a User-Agent fragment blacklist to MobileProfile: sticking iPad on the regular theme, which works better on its larger screen (was tripped on 'mobile' in the UA though we had no explicit check for 'ipad' previously)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MobileProfile/MobileProfilePlugin.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index a104eadd7..60bb3b68f 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -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); |