From 839871e486723f775771d4621c32e75ec329a3f7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 5 Feb 2008 22:35:28 +0000 Subject: [PATCH] Fix for XML type checks... don't look for the closing angle-brace on the root tag, as it may not be in the header chunk we read. Some SVGs have a lot of attributes on the root element! --- includes/MimeMagic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index e144f7c0d5..90009f5fea 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -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 "
ANALYSING $file ($mime): doctype= $doctype; tag= $tag
"; + #print "
ANALYSING $file: doctype= $doctype; tag= $tag
"; if ( strpos( $doctype, "-//W3C//DTD SVG" ) === 0 ) { return "image/svg+xml"; -- 2.20.1