From: Alexandre Emsenhuber Date: Sat, 3 May 2008 16:07:57 +0000 (+0000) Subject: Custom rollback summaries now accept the same arguments as the default message X-Git-Tag: 1.31.0-rc.0~47926 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=cd225d19bf2b66c5734528039bf3c2d5c961f561;p=lhc%2Fweb%2Fwiklou.git Custom rollback summaries now accept the same arguments as the default message --- 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;