* (bug 31921) Fix for r78201: magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 24 Oct 2011 16:14:49 +0000 (16:14 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 24 Oct 2011 16:14:49 +0000 (16:14 +0000)
RELEASE-NOTES-1.19
includes/parser/Parser.php

index 5337ee6..8a4691a 100644 (file)
@@ -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.
index 94ca585..4b7093c 100644 (file)
@@ -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__ );
                }