* Fix for size checks on SVG images with global 'stroke-width' attribute
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:17:47 +0000 (18:17 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:17:47 +0000 (18:17 +0000)
RELEASE-NOTES
includes/ImageFunctions.php

index c31fb57..40addaa 100644 (file)
@@ -124,6 +124,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6447) Trackbacks now work with transactional tables, if enabled
 * (bug 6892, 7147) Trackback error handling, optional fields more robust
 * (bug 6813) Don't break HTML validator when using trackbacks
+* Fix for size checks on SVG images with global 'stroke-width' attribute
 
 
 === API changes in 1.13 ===
index 3e87c99..ee8cda1 100644 (file)
@@ -53,10 +53,10 @@ function wfGetSVGsize( $filename ) {
                return false;
        }
        $tag = $matches[1];
-       if( preg_match( '/\bwidth\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
+       if( preg_match( '/(?:^|\s)width\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
                $width = wfScaleSVGUnit( trim( substr( $matches[1], 1, -1 ) ) );
        }
-       if( preg_match( '/\bheight\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
+       if( preg_match( '/(?:^|\s)height\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
                $height = wfScaleSVGUnit( trim( substr( $matches[1], 1, -1 ) ) );
        }