diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-08-05 18:55:47 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-08-05 18:55:47 -0400 |
commit | b975a6a0e5a5a7332eea4834494029c5c1238540 (patch) | |
tree | f43c242b21473dc1828dcf9d36925bffdb601874 /lib/htmloutputter.php | |
parent | 95ba22c5d7ffb28fa5c44a398edca86cc0f637f5 (diff) |
Don't start HTML responses with <?xml if the document is served as text/html.
Starting a text/html mime type document with <?xml causes some browsers (previous version of Opera and IE) to switch to Quirks Mode.
Diffstat (limited to 'lib/htmloutputter.php')
-rw-r--r-- | lib/htmloutputter.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index cba8a5f5e..8f3b1a609 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -109,8 +109,13 @@ class HTMLOutputter extends XMLOutputter header('Content-Type: '.$type); $this->extraHeaders(); - - $this->startXML('html'); + if( ! substr($type,0,strlen('text/html'))=='text/html' ){ + // Browsers don't like it when <?xml it output for non-xhtml documents + $this->xw->startDocument('1.0', 'UTF-8'); + } + if ($doc) { + $this->xw->writeDTD('html', $public, $system); + } $language = $this->getLanguage(); |