X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fpage%2FWikiFilePage.php;h=4c2ebdc29712605c9d810658151c6e8a8f3b062b;hb=e5879da149afe183ce889ef6f4158086c9b4735f;hp=66fadf5eedadc7f69950f4211c033d152eea57b4;hpb=2dd58ade75d15a5895c0c010e17b6f729a0f72fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiFilePage.php b/includes/page/WikiFilePage.php index 66fadf5eed..4c2ebdc297 100644 --- a/includes/page/WikiFilePage.php +++ b/includes/page/WikiFilePage.php @@ -170,21 +170,33 @@ class WikiFilePage extends WikiPage { */ public function doPurge() { $this->loadFile(); + if ( $this->mFile->exists() ) { wfDebug( 'ImagePage::doPurge purging ' . $this->mFile->getName() . "\n" ); - DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->mTitle, 'imagelinks' ) ); - $this->mFile->purgeCache( [ 'forThumbRefresh' => true ] ); + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $this->mTitle, 'imagelinks', 'file-purge' ) + ); } else { wfDebug( 'ImagePage::doPurge no image for ' . $this->mFile->getName() . "; limiting purge to cache only\n" ); - // even if the file supposedly doesn't exist, force any cached information - // to be updated (in case the cached information is wrong) - $this->mFile->purgeCache( [ 'forThumbRefresh' => true ] ); } + + // even if the file supposedly doesn't exist, force any cached information + // to be updated (in case the cached information is wrong) + + // Purge current version and its thumbnails + $this->mFile->purgeCache( [ 'forThumbRefresh' => true ] ); + + // Purge the old versions and their thumbnails + foreach ( $this->mFile->getHistory() as $oldFile ) { + $oldFile->purgeCache( [ 'forThumbRefresh' => true ] ); + } + if ( $this->mRepo ) { // Purge redirect cache $this->mRepo->invalidateImageRedirect( $this->mTitle ); } + return parent::doPurge(); }