From: Brion Vibber Date: Mon, 24 Mar 2008 18:17:47 +0000 (+0000) Subject: * Fix for size checks on SVG images with global 'stroke-width' attribute X-Git-Tag: 1.31.0-rc.0~48849 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=0310f289f78eb7769143509f48126dec789a80fe;p=lhc%2Fweb%2Fwiklou.git * Fix for size checks on SVG images with global 'stroke-width' attribute --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c31fb57d25..40addaa1dc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php index 3e87c994c6..ee8cda164f 100644 --- a/includes/ImageFunctions.php +++ b/includes/ImageFunctions.php @@ -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 ) ) ); }