Better check to see if the XML prolog should be outputted for XML

documents i.e., if best mimetype is */*xml, then use the XML prolog.
This commit is contained in:
Sarven Capadisli 2009-09-30 10:53:04 +00:00
parent 353f58c231
commit 1e7df7fbab
1 changed files with 2 additions and 2 deletions

View File

@ -109,8 +109,8 @@ class HTMLOutputter extends XMLOutputter
header('Content-Type: '.$type.'; charset=UTF-8');
$this->extraHeaders();
if( ! substr($type,0,strlen('text/html'))=='text/html' ){
// Browsers don't like it when <?xml it output for non-xhtml documents
if (preg_match("/.*\/.*xml/", $type)) {
// Required for XML documents
$this->xw->startDocument('1.0', 'UTF-8');
}
$this->xw->writeDTD('html',