From 7206580366d51572a896b006506a5e3fb8bb4add Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 21 Jan 2013 13:36:01 -0800 Subject: [PATCH] [FileRepo] Flipped RENDER_FORCE check order to avoid stat. Change-Id: Ia12ea5a1152c49901a7f1157b06fd113c64fdec9 --- includes/filerepo/file/File.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 9adcc99635..bfb91972de 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -903,13 +903,14 @@ abstract class File { $this->migrateThumbFile( $thumbName ); // Check if an up-to-date thumbnail already exists... wfDebug( __METHOD__.": Doing stat for $thumbPath\n" ); - if ( $this->repo->fileExists( $thumbPath ) && !( $flags & self::RENDER_FORCE ) ) { + if ( !( $flags & self::RENDER_FORCE ) && $this->repo->fileExists( $thumbPath ) ) { $timestamp = $this->repo->getFileTimestamp( $thumbPath ); if ( $timestamp !== false && $timestamp >= $wgThumbnailEpoch ) { // XXX: Pass in the storage path even though we are not rendering anything // and the path is supposed to be an FS path. This is due to getScalerType() // getting called on the path and clobbering $thumb->getUrl() if it's false. - $thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); + $thumb = $this->handler->getTransform( + $this, $thumbPath, $thumbUrl, $params ); $thumb->setStoragePath( $thumbPath ); break; } -- 2.20.1