From: Aaron Schulz Date: Mon, 21 Jan 2013 21:36:01 +0000 (-0800) Subject: [FileRepo] Flipped RENDER_FORCE check order to avoid stat. X-Git-Tag: 1.31.0-rc.0~20965^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=7206580366d51572a896b006506a5e3fb8bb4add;p=lhc%2Fweb%2Fwiklou.git [FileRepo] Flipped RENDER_FORCE check order to avoid stat. Change-Id: Ia12ea5a1152c49901a7f1157b06fd113c64fdec9 --- 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; }