From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- includes/ImageFunctions.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'includes/ImageFunctions.php') diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php index 3e87c994..af05c1c9 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 ) ) ); } @@ -73,8 +73,8 @@ function wfGetSVGsize( $filename ) { * * Any subsequent links on the same line are considered to be exceptions, * i.e. articles where the image may occur inline. * - * @param string $name the image name to check - * @param Title $contextTitle The page on which the image occurs, if known + * @param $name string the image name to check + * @param $contextTitle Title: the page on which the image occurs, if known * @return bool */ function wfIsBadImage( $name, $contextTitle = false ) { @@ -122,7 +122,7 @@ function wfIsBadImage( $name, $contextTitle = false ) { } } } - + $contextKey = $contextTitle ? $contextTitle->getPrefixedDBkey() : false; $bad = isset( $badImages[$name] ) && !isset( $badImages[$name][$contextKey] ); wfProfileOut( __METHOD__ ); @@ -145,6 +145,3 @@ function wfFitBoxWidth( $boxWidth, $boxHeight, $maxHeight ) { else return $roundedUp; } - - - -- cgit v1.2.3-54-g00ecf