X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FWikiFilePage.php;h=4c2ebdc29712605c9d810658151c6e8a8f3b062b;hb=9a37fb8e4851d13bfb208eb886c9947a7f21571c;hp=66fadf5eedadc7f69950f4211c033d152eea57b4;hpb=3cb14f56bdf3271769a5866f9dcaad56bf873aea;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(); }