From: Aaron Schulz Date: Fri, 23 Oct 2015 19:35:43 +0000 (-0700) Subject: Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry() X-Git-Tag: 1.31.0-rc.0~9278^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0fc6c8b592ae2cd2c169de4e3305e424f0625c4b;p=lhc%2Fweb%2Fwiklou.git Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry() * Setting mCacheTime to -1 is for old callers that only check getCacheTime() instead of getCacheExpiry(). Most of them are already broken (WikiLog/SemanticForms) as they check for -1 which is in fact never returned due to the TS_MW conversion in Parser::getCacheTime. * By using -1, the value of page_links_updated can end up as 1969, which is confusing and broken. Change-Id: I8809a4258eacff05992a2c27ade7f6a0c1731c51 --- diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php index 7acfe38cfc..2451390dc2 100644 --- a/includes/parser/CacheTime.php +++ b/includes/parser/CacheTime.php @@ -93,11 +93,6 @@ class CacheTime { if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) { $this->mCacheExpiry = $seconds; } - - // hack: set old-style marker for uncacheable entries. - if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) { - $this->mCacheTime = -1; - } } /** diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index efad151b6c..9060756a82 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5763,7 +5763,6 @@ class Parser { throw new MWException( __METHOD__ . " can only be called when actually parsing something" ); } - $this->mOutput->setCacheTime( -1 ); // old style, for compatibility $this->mOutput->updateCacheExpiry( 0 ); // new style, for consistency }