From: Alexandre Emsenhuber Date: Mon, 24 Oct 2011 16:14:49 +0000 (+0000) Subject: * (bug 31921) Fix for r78201: magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR... X-Git-Tag: 1.31.0-rc.0~26932 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%24wgLogo?a=commitdiff_plain;h=0ba7a5f510085769df2d6202308259dacaa06a2b;p=lhc%2Fweb%2Fwiklou.git * (bug 31921) Fix for r78201: magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give current values on preview --- 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__ ); }