From 0fc6c8b592ae2cd2c169de4e3305e424f0625c4b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 23 Oct 2015 12:35:43 -0700 Subject: [PATCH] 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 --- includes/parser/CacheTime.php | 5 ----- includes/parser/Parser.php | 1 - 2 files changed, 6 deletions(-) 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 } -- 2.20.1