Optional summary parameter to action=rollback, for user javascript
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 4 Dec 2005 06:05:27 +0000 (06:05 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 4 Dec 2005 06:05:27 +0000 (06:05 +0000)
RELEASE-NOTES
includes/Article.php

index dd6a82a..fb5e1dd 100644 (file)
@@ -286,6 +286,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * Fix XML validity checks in parser tests on PHP 5.1
 * (bug 3844) ab: av: ba: ce: & kv: now inherit from LanguageRu.php
              ii: & za: now inherit from LanguageZn_cn.php
+* Optional summary parameter to action=rollback, for user javascript
 
 
 === Caveats ===
index 76670c2..5b6c6b9 100644 (file)
@@ -2119,15 +2119,17 @@ class Article {
                        );
                }
 
-               # Save it!
+               # Get the edit summary
                $target = Revision::newFromId( $s->rev_id );
-               $newcomment = wfMsgForContent( 'revertpage', $target->getUserText(), $from );
+               $newComment = wfMsgForContent( 'revertpage', $target->getUserText(), $from );
+               $newComment = $wgRequest->getText( 'summary', $newComment );
 
+               # Save it!
                $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
-               $wgOut->addHTML( '<h2>' . htmlspecialchars( $newcomment ) . "</h2>\n<hr />\n" );
+               $wgOut->addHTML( '<h2>' . htmlspecialchars( $newComment ) . "</h2>\n<hr />\n" );
 
-               $this->updateArticle( $target->getText(), $newcomment, 1, $this->mTitle->userIsWatching(), $bot );
+               $this->updateArticle( $target->getText(), $newComment, 1, $this->mTitle->userIsWatching(), $bot );
                Article::onArticleEdit( $this->mTitle );
 
                $dbw->commit();