(bug 20159) thumbs rerendring if older that
authorJure Kajzer <freakolowsky@users.mediawiki.org>
Thu, 3 Dec 2009 16:09:22 +0000 (16:09 +0000)
committerJure Kajzer <freakolowsky@users.mediawiki.org>
Thu, 3 Dec 2009 16:09:22 +0000 (16:09 +0000)
RELEASE-NOTES
includes/filerepo/File.php

index b411ed1..3683eb0 100644 (file)
@@ -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 ==
 
index c964d5a..9968ace 100644 (file)
@@ -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;
                        }