Fix for XML type checks... don't look for the closing angle-brace on the root tag...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 5 Feb 2008 22:35:28 +0000 (22:35 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 5 Feb 2008 22:35:28 +0000 (22:35 +0000)
includes/MimeMagic.php

index e144f7c..90009f5 100644 (file)
@@ -479,11 +479,11 @@ class MimeMagic {
                                $head, $match ) ) {
                                        $doctype = $match[1];
                                }
-                       if ( preg_match( '%<(\w+).*>%sim', $head, $match ) ) {
+                       if ( preg_match( '%<(\w+)\b%si', $head, $match ) ) {
                                $tag = $match[1];
                        }
 
-                       #print "<br>ANALYSING $file ($mime): doctype= $doctype; tag= $tag<br>";
+                       #print "<br>ANALYSING $file: doctype= $doctype; tag= $tag<br>";
 
                        if ( strpos( $doctype, "-//W3C//DTD SVG" ) === 0 ) {
                                return "image/svg+xml";