diff --git a/includes/EditPage.php b/includes/EditPage.php index 7b08c0e8d0c..77757100422 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -70,7 +70,7 @@ class EditPage { * Fetch initial editing page content. */ private function getContent() { - global $wgRequest, $wgParser; + global $wgOut, $wgRequest, $wgParser; # Get variables from query string :P $section = $wgRequest->getVal( 'section' ); @@ -116,19 +116,16 @@ class EditPage { } else { $result = true; } - - if (!$result) { - #Undoing failed. Bailing out with regular revision text. - $text = $currev_text; - - #Give a warning - $this->editFormPageTop .= "
'.wfMsg('explainundofailed').'
'; + + if( $result ) { + # Inform the user of our success and set an automatic edit summary + $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-success' ) ); + $this->summary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() ); } else { - $this->editFormPageTop .= ''.wfMsg('explainundosucceeded').'
'; - $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText()); + # Warn the user that something went wrong + $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-failure' ) ); } + } } else if( $section != '' ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 568e6a6732b..6e9af9f9cc7 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1012,10 +1012,10 @@ the text into a text file and save it for later.', 'nocreatetitle' => 'Page creation limited', 'nocreatetext' => 'This site has restricted the ability to create new pages. You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].', -'undofailed' => 'Undo Failed', -'explainundofailed' => 'The edit could not be undone because of conflicting intermediate edits. Please manually undo the edits.', -'undosucceeded' => 'Undo Succeeded', -'explainundosucceeded' => 'The edit was successfully undone. Please click save to apply this change.', + +# "Undo" feature +'undo-success' => 'The edit has been undone. Please confirm, and then save the changes below.', +'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.', 'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])', # Account creation failure