From 483600163c3654ccd45c0a2716729f5624ea3c5a Mon Sep 17 00:00:00 2001 From: Jure Kajzer Date: Thu, 3 Dec 2009 16:09:22 +0000 Subject: [PATCH] (bug 20159) thumbs rerendring if older that --- RELEASE-NOTES | 1 + includes/filerepo/File.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b411ed1e4c..3683eb012b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -660,6 +660,7 @@ Hopefully we will remove this configuration var soon) * (bug 21740) Attempting to protect a page that doesn't exist (salting) returns "unknown error" * (bug 18762) both redirects and links get fixed one after another if redirects-only switch is not present +* (bug 20159) thumbnails rerendered if older that $wgThumbnailEpoch == API changes in 1.16 == diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index c964d5a9ee..9968ace2bf 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -529,7 +529,7 @@ abstract class File { * @return MediaTransformOutput */ function transform( $params, $flags = 0 ) { - global $wgUseSquid, $wgIgnoreImageErrors; + global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch; wfProfileIn( __METHOD__ ); do { @@ -561,7 +561,7 @@ abstract class File { wfDebug( __METHOD__.": Doing stat for $thumbPath\n" ); $this->migrateThumbFile( $thumbName ); - if ( file_exists( $thumbPath ) ) { + if ( ( $thumbTime = filemtime( $thumbPath ) ) !== FALSE && gmdate( 'YmdHis', $thumbTime ) >= $wgThumbnailEpoch ) { $thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); break; } -- 2.20.1