From 449b936efdd82678cb20971328e46f5740ba9999 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= Date: Tue, 11 May 2010 16:24:14 +0000 Subject: [PATCH] (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new variable {{REVISIONMONTH1}} when unpadded version is needed. --- RELEASE-NOTES | 2 ++ includes/MagicWord.php | 1 + includes/parser/Parser.php | 7 +++++++ languages/messages/MessagesEn.php | 1 + 4 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a308a8274f..b1fc9c2230 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -160,6 +160,8 @@ in a negative namespace (which is invalid). * (bug 23422) mp3 files can now be moved * (bug 23448) MediaWiki:Summary-preview is now displayed instead of MediaWiki:Subject-preview when previewing summary +* (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new + variable {{REVISIONMONTH1}} when unpadded version is needed. === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/MagicWord.php b/includes/MagicWord.php index d741832f61..d05bf19da2 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -79,6 +79,7 @@ class MagicWord { 'revisionday', 'revisionday2', 'revisionmonth', + 'revisionmonth1', 'revisionyear', 'revisiontimestamp', 'revisionuser', diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7032b86b1e..9b920aeb76 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2528,6 +2528,13 @@ class Parser { # *after* a revision ID has been assigned. This is for null edits. $this->mOutput->setFlag( 'vary-revision' ); wfDebug( __METHOD__ . ": {{REVISIONMONTH}} used, setting vary-revision...\n" ); + $value = substr( $this->getRevisionTimestamp(), 4, 2 ); + break; + case 'revisionmonth1': + # Let the edit saving system know we should parse the page + # *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONMONTH1}} used, setting vary-revision...\n" ); $value = intval( substr( $this->getRevisionTimestamp(), 4, 2 ) ); break; case 'revisionyear': diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 712661590f..63e3c4e844 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -311,6 +311,7 @@ $magicWords = array( 'revisionday' => array( 1, 'REVISIONDAY' ), 'revisionday2' => array( 1, 'REVISIONDAY2' ), 'revisionmonth' => array( 1, 'REVISIONMONTH' ), + 'revisionmonth1' => array( 1, 'REVISIONMONTH1' ), 'revisionyear' => array( 1, 'REVISIONYEAR' ), 'revisiontimestamp' => array( 1, 'REVISIONTIMESTAMP' ), 'revisionuser' => array( 1, 'REVISIONUSER' ), -- 2.20.1