]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Better check to see if the XML prolog should be outputted for XML
authorSarven Capadisli <csarven@status.net>
Wed, 30 Sep 2009 10:53:04 +0000 (10:53 +0000)
committerSarven Capadisli <csarven@status.net>
Wed, 30 Sep 2009 10:53:04 +0000 (10:53 +0000)
documents i.e., if best mimetype is */*xml, then use the XML prolog.

lib/htmloutputter.php

index 99f956545b9486914da4a67511fead66daa1ade9..64be745bebe85daa14998d451df7eb5bddda4701 100644 (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',