From a7d35676ebfe6a6c9d9ba7120f9f26aef436d9ba Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 12 Jan 2006 04:38:20 +0000 Subject: [PATCH] fixed infinite recursion in SVG error path --- includes/Image.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 17f3f8cb01..89cf299b18 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -946,9 +946,10 @@ class Image } # Don't make an image bigger than the source, or wgMaxSVGSize for SVGs - $maxsize = $this->mustRender() ? $wgSVGMaxSize : $this->width - 1; - if( $width > $maxsize ) { - $thumb = new ThumbnailImage( $this->getViewURL(), $this->getWidth(), $this->getHeight() ); + if ( $this->mustRender() ) { + $width = min( $width, $wgSVGMaxSize ); + } elseif ( $width > $this->width - 1 ) { + $thumb = new ThumbnailImage( $this->getURL(), $this->getWidth(), $this->getHeight() ); wfProfileOut( $fname ); return $thumb; } -- 2.20.1