From 0ba7a5f510085769df2d6202308259dacaa06a2b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 24 Oct 2011 16:14:49 +0000 Subject: [PATCH] * (bug 31921) Fix for r78201: magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give current values on preview --- RELEASE-NOTES-1.19 | 2 ++ includes/parser/Parser.php | 22 ++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 5337ee63e1..8a4691a9b4 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -113,6 +113,8 @@ production. * (bug 31692) "summary" parameter now also work when undoing revisions * (bug 18823) "move succeeded" text displayed bluelinks even when redirect was suppressed +* (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give + current values on preview === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 94ca585261..4b7093cd46 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5368,20 +5368,18 @@ class Parser { if ( is_null( $this->mRevisionTimestamp ) ) { wfProfileIn( __METHOD__ ); - $revObject = $this->getRevisionObject(); - $timestamp = $revObject ? $revObject->getTimestamp() : false; + global $wgContLang; - if( $timestamp !== false ) { - global $wgContLang; + $revObject = $this->getRevisionObject(); + $timestamp = $revObject ? $revObject->getTimestamp() : wfTimestampNow(); - # The cryptic '' timezone parameter tells to use the site-default - # timezone offset instead of the user settings. - # - # Since this value will be saved into the parser cache, served - # to other users, and potentially even used inside links and such, - # it needs to be consistent for all visitors. - $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); - } + # The cryptic '' timezone parameter tells to use the site-default + # timezone offset instead of the user settings. + # + # Since this value will be saved into the parser cache, served + # to other users, and potentially even used inside links and such, + # it needs to be consistent for all visitors. + $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); wfProfileOut( __METHOD__ ); } -- 2.20.1