From: Chad Horohoe Date: Wed, 10 Aug 2011 23:29:08 +0000 (+0000) Subject: (bug 30192) Old thumbnails not properly purged. Unlike the bug suggests, we don't... X-Git-Tag: 1.31.0-rc.0~28367 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=968d2b47c9d0058d192000d9d518cb143e55ae85;p=lhc%2Fweb%2Fwiklou.git (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() --- 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 ); }