From: Jeroen De Dauw Date: Mon, 19 Mar 2012 22:37:05 +0000 (+0000) Subject: only init if not already done so X-Git-Tag: 1.31.0-rc.0~24190 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=2954d2dff5b665f3ce127454abb4c835af833f8e;p=lhc%2Fweb%2Fwiklou.git only init if not already done so --- 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(); + } } /**