From 2954d2dff5b665f3ce127454abb4c835af833f8e Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Mon, 19 Mar 2012 22:37:05 +0000 Subject: [PATCH] only init if not already done so --- includes/specials/SpecialCachedPage.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/specials/SpecialCachedPage.php b/includes/specials/SpecialCachedPage.php index 3946c8e4df..3d910920ac 100644 --- a/includes/specials/SpecialCachedPage.php +++ b/includes/specials/SpecialCachedPage.php @@ -78,19 +78,21 @@ abstract class SpecialCachedPage extends SpecialPage { * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. */ public function startCache( $cacheExpiry = null, $cacheEnabled = null ) { - if ( !is_null( $cacheExpiry ) ) { - $this->cacheExpiry = $cacheExpiry; - } + if ( is_null( $this->hasCached ) ) { + if ( !is_null( $cacheExpiry ) ) { + $this->cacheExpiry = $cacheExpiry; + } - if ( !is_null( $cacheEnabled ) ) { - $this->setCacheEnabled( $cacheEnabled ); - } + if ( !is_null( $cacheEnabled ) ) { + $this->setCacheEnabled( $cacheEnabled ); + } - if ( $this->getRequest()->getText( 'action' ) === 'purge' ) { - $this->hasCached = false; - } + if ( $this->getRequest()->getText( 'action' ) === 'purge' ) { + $this->hasCached = false; + } - $this->initCaching(); + $this->initCaching(); + } } /** -- 2.20.1