Only use mobile doctype on actual mobile devices.

This commit is contained in:
Samantha Doherty 2011-05-31 12:14:26 -04:00
parent ac55efeecf
commit a026608953
1 changed files with 20 additions and 11 deletions

View File

@ -49,6 +49,7 @@ class MobileProfilePlugin extends WAP20Plugin
{
public $DTD = null;
public $serveMobile = false;
public $reallyMobile = false;
public $mobileFeatures = array();
function __construct($DTD='http://www.wapforum.org/DTD/xhtml-mobile10.dtd')
@ -160,6 +161,7 @@ class MobileProfilePlugin extends WAP20Plugin
$this->setMobileFeatures($httpuseragent);
$this->serveMobile = true;
$this->reallyMobile = true;
break;
}
}
@ -201,6 +203,8 @@ class MobileProfilePlugin extends WAP20Plugin
header('Content-Type: '.$type);
if ($this->reallyMobile) {
$action->extraHeaders();
if (preg_match("/.*\/.*xml/", $type)) {
// Required for XML documents
@ -216,6 +220,11 @@ class MobileProfilePlugin extends WAP20Plugin
'xml:lang' => $language));
return false;
} else {
return true;
}
}
function setMobileFeatures($useragent)