Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -113,6 +113,8 @@ |
114 | 114 | * (bug 31692) "summary" parameter now also work when undoing revisions |
115 | 115 | * (bug 18823) "move succeeded" text displayed bluelinks even when redirect was |
116 | 116 | suppressed |
| 117 | +* (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give |
| 118 | + current values on preview |
117 | 119 | |
118 | 120 | === API changes in 1.19 === |
119 | 121 | * (bug 19838) siprop=interwikimap can now use the interwiki cache. |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -5368,21 +5368,19 @@ |
5369 | 5369 | if ( is_null( $this->mRevisionTimestamp ) ) { |
5370 | 5370 | wfProfileIn( __METHOD__ ); |
5371 | 5371 | |
| 5372 | + global $wgContLang; |
| 5373 | + |
5372 | 5374 | $revObject = $this->getRevisionObject(); |
5373 | | - $timestamp = $revObject ? $revObject->getTimestamp() : false; |
| 5375 | + $timestamp = $revObject ? $revObject->getTimestamp() : wfTimestampNow(); |
5374 | 5376 | |
5375 | | - if( $timestamp !== false ) { |
5376 | | - global $wgContLang; |
| 5377 | + # The cryptic '' timezone parameter tells to use the site-default |
| 5378 | + # timezone offset instead of the user settings. |
| 5379 | + # |
| 5380 | + # Since this value will be saved into the parser cache, served |
| 5381 | + # to other users, and potentially even used inside links and such, |
| 5382 | + # it needs to be consistent for all visitors. |
| 5383 | + $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); |
5377 | 5384 | |
5378 | | - # The cryptic '' timezone parameter tells to use the site-default |
5379 | | - # timezone offset instead of the user settings. |
5380 | | - # |
5381 | | - # Since this value will be saved into the parser cache, served |
5382 | | - # to other users, and potentially even used inside links and such, |
5383 | | - # it needs to be consistent for all visitors. |
5384 | | - $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); |
5385 | | - } |
5386 | | - |
5387 | 5385 | wfProfileOut( __METHOD__ ); |
5388 | 5386 | } |
5389 | 5387 | return $this->mRevisionTimestamp; |