summaryrefslogtreecommitdiff
path: root/plugins/MobileProfile/MobileProfilePlugin.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-06 15:22:23 -0700
committerBrion Vibber <brion@pobox.com>2010-04-06 15:22:23 -0700
commit5dc169260dc36209dd5ad0d4d4cac2bdaaefe62c (patch)
treec5fb50f7fbf6ff20b581c1ad5b50f2e19e6d7584 /plugins/MobileProfile/MobileProfilePlugin.php
parenta3314f483ec3250b322666a769a10197fb9dfff0 (diff)
parent4bb75d1c8e22b7bfc689a9e582ef846515a90383 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/MobileProfile/MobileProfilePlugin.php')
-rw-r--r--plugins/MobileProfile/MobileProfilePlugin.php36
1 files changed, 27 insertions, 9 deletions
diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php
index 0b37734b7..60bb3b68f 100644
--- a/plugins/MobileProfile/MobileProfilePlugin.php
+++ b/plugins/MobileProfile/MobileProfilePlugin.php
@@ -73,9 +73,11 @@ class MobileProfilePlugin extends WAP20Plugin
$this->serveMobile = true;
} else {
// If they like the WAP 2.0 mimetype, serve them MP
- if (strstr('application/vnd.wap.xhtml+xml', $type) !== false) {
- $this->serveMobile = true;
- } else {
+ // @fixme $type is undefined, making this if case useless and spewing errors.
+ // What's the intent?
+ //if (strstr('application/vnd.wap.xhtml+xml', $type) !== false) {
+ // $this->serveMobile = true;
+ //} else {
// If they are a mobile device that supports WAP 2.0,
// serve them MP
@@ -139,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);
@@ -149,7 +162,7 @@ class MobileProfilePlugin extends WAP20Plugin
break;
}
}
- }
+ //}
// If they are okay with MP, and the site has a mobile server,
// redirect there
@@ -167,7 +180,9 @@ class MobileProfilePlugin extends WAP20Plugin
return true;
}
- if (!$type) {
+ // @fixme $type is undefined, making this if case useless and spewing errors.
+ // What's the intent?
+ //if (!$type) {
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ?
$_SERVER['HTTP_ACCEPT'] : null;
@@ -180,7 +195,7 @@ class MobileProfilePlugin extends WAP20Plugin
throw new ClientException(_('This page is not available in a '.
'media type you accept'), 406);
}
- }
+ //}
header('Content-Type: '.$type);
@@ -221,9 +236,12 @@ class MobileProfilePlugin extends WAP20Plugin
function onStartShowHeadElements($action)
{
- if (!$action->serveMobile) {
- return true;
- }
+ // @fixme nothing appears to set a serveMobile on any action,
+ // so this is useless and spews errors. Is this supposed to be
+ // checking $this?
+ //if (!$action->serveMobile) {
+ // return true;
+ //}
$action->showTitle();
$action->showShortcutIcon();