From: Jure Kajzer Date: Thu, 3 Dec 2009 16:09:22 +0000 (+0000) Subject: (bug 20159) thumbs rerendring if older that X-Git-Tag: 1.31.0-rc.0~38641 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=483600163c3654ccd45c0a2716729f5624ea3c5a;p=lhc%2Fweb%2Fwiklou.git (bug 20159) thumbs rerendring if older that --- 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; }