r32374 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32373‎ | r32374 | r32375 >
Date:18:17, 24 March 2008
Author:brion
Status:old
Tags:
Comment:
* Fix for size checks on SVG images with global 'stroke-width' attribute
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ImageFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImageFunctions.php
@@ -53,10 +53,10 @@
5454 return false;
5555 }
5656 $tag = $matches[1];
57 - if( preg_match( '/\bwidth\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
 57+ if( preg_match( '/(?:^|\s)width\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
5858 $width = wfScaleSVGUnit( trim( substr( $matches[1], 1, -1 ) ) );
5959 }
60 - if( preg_match( '/\bheight\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
 60+ if( preg_match( '/(?:^|\s)height\s*=\s*("[^"]+"|\'[^\']+\')/s', $tag, $matches ) ) {
6161 $height = wfScaleSVGUnit( trim( substr( $matches[1], 1, -1 ) ) );
6262 }
6363
Index: trunk/phase3/RELEASE-NOTES
@@ -124,6 +124,7 @@
125125 * (bug 6447) Trackbacks now work with transactional tables, if enabled
126126 * (bug 6892, 7147) Trackback error handling, optional fields more robust
127127 * (bug 6813) Don't break HTML validator when using trackbacks
 128+* Fix for size checks on SVG images with global 'stroke-width' attribute
128129
129130
130131 === API changes in 1.13 ===

Status & tagging log