From 968d2b47c9d0058d192000d9d518cb143e55ae85 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 10 Aug 2011 23:29:08 +0000 Subject: [PATCH] (bug 30192) Old thumbnails not properly purged. Unlike the bug suggests, we don't need to also purge from LocalFile::purgeCache(), since that code path ends up calling purgeHistory() anyway. A lot of this could probably be protected...not much calls these outside of FileRepo code other than File::purgeCache() --- includes/filerepo/LocalFile.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index e940fd4575..d879f07b78 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -655,6 +655,11 @@ class LocalFile extends File { $hashedName = md5( $this->getName() ); $oldKey = $this->repo->getSharedCacheKey( 'oldfile', $hashedName ); + // Must purge thumbnails for old versions too! bug 30192 + foreach( $this->getHistory() as $oldFile ) { + $oldFile->purgeThumbnails(); + } + if ( $oldKey ) { $wgMemc->delete( $oldKey ); } -- 2.20.1