From f054c4e58fd3a5cc4d7b628d660947ad84c861ed Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Wed, 19 May 2010 00:40:48 +0000 Subject: [PATCH] Repair makeThumbLink2() getUnscaledThumb() to pass along the handlerparams to transform() Fixes bug 23577 --- includes/Linker.php | 4 ++-- includes/filerepo/File.php | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 1398a4447a..13c68afef2 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -594,14 +594,14 @@ class Linker { if( $manual_title ) { $manual_img = wfFindFile( $manual_title ); if ( $manual_img ) { - $thumb = $manual_img->getUnscaledThumb(); + $thumb = $manual_img->getUnscaledThumb( $hp ); } else { $exists = false; } } } elseif ( isset( $fp['framed'] ) ) { // Use image dimensions, don't scale - $thumb = $file->getUnscaledThumb( $page ); + $thumb = $file->getUnscaledThumb( $hp ); } else { # Do not present an image bigger than the source, for bitmap-style images # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index b0ce671081..9e9834875a 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -438,20 +438,15 @@ abstract class File { /** * Get a ThumbnailImage which is the same size as the source */ - function getUnscaledThumb( $page = false ) { + function getUnscaledThumb( $handlerParams = array() ) { + $hp =& $handlerParams; + $page = isset( $hp['page'] ) ? $hp['page'] : false; $width = $this->getWidth( $page ); if ( !$width ) { return $this->iconThumb(); } - if ( $page ) { - $params = array( - 'page' => $page, - 'width' => $this->getWidth( $page ) - ); - } else { - $params = array( 'width' => $this->getWidth() ); - } - return $this->transform( $params ); + $hp['width'] = $width; + return $this->transform( $hp ); } /** -- 2.20.1