From cd225d19bf2b66c5734528039bf3c2d5c961f561 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 3 May 2008 16:07:57 +0000 Subject: [PATCH] Custom rollback summaries now accept the same arguments as the default message --- RELEASE-NOTES | 1 + includes/Article.php | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 19fe2ee0f9..b16441404c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -97,6 +97,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Update documentation links in auto-generated LocalSettings.php * (bug 13584) The new hook SkinTemplateToolboxEnd was added. * (bug 709) Cannot rename/move images and other media files [EXPERIMENTAL] +* Custom rollback summaries now accept the same arguments as the default message === Bug fixes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 6b141b3f32..6e714fae2c 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2423,7 +2423,7 @@ class Article { * doRollback() instead. */ public function commitRollback($fromP, $summary, $bot, &$resultDetails) { - global $wgUseRCPatrol, $wgUser; + global $wgUseRCPatrol, $wgUser, $wgLang; $dbw = wfGetDB( DB_MASTER ); if( wfReadOnly() ) { @@ -2488,15 +2488,17 @@ class Article { # Generate the edit summary if necessary $target = Revision::newFromId( $s->rev_id ); - if( empty( $summary ) ) - { - global $wgLang; - $summary = wfMsgForContent( 'revertpage', - $target->getUserText(), $from, - $s->rev_id, $wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true), - $current->getId(), $wgLang->timeanddate($current->getTimestamp()) - ); + if( empty( $summary ) ){ + $summary = wfMsgForContent( 'revertpage' ); } + + # Allow the custom summary to use the same args as the default message + $args = array( + $target->getUserText(), $from, $s->rev_id, + $wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true), + $current->getId(), $wgLang->timeanddate($current->getTimestamp()) + ); + $summary = wfMsgReplaceArgs( $summary, $args ); # Save $flags = EDIT_UPDATE; -- 2.20.1