Merge "Fix undo edit summary when the user who made the old revision is hidden"
[lhc/web/wiklou.git] / includes / EditPage.php
index c84daa6..84bb493 100644 (file)
@@ -935,7 +935,19 @@ class EditPage {
                                                        # If we just undid one rev, use an autosummary
                                                        $firstrev = $oldrev->getNext();
                                                        if ( $firstrev && $firstrev->getId() == $undo ) {
-                                                               $undoSummary = wfMessage( 'undo-summary', $undo, $undorev->getUserText() )->inContentLanguage()->text();
+                                                               $userText = $undorev->getUserText();
+                                                               if ( $userText === '' ) {
+                                                                       $undoSummary = wfMessage(
+                                                                               'undo-summary-username-hidden',
+                                                                               $undo
+                                                                       )->inContentLanguage()->text();
+                                                               } else {
+                                                                       $undoSummary = wfMessage(
+                                                                               'undo-summary',
+                                                                               $undo,
+                                                                               $userText
+                                                                       )->inContentLanguage()->text();
+                                                               }
                                                                if ( $this->summary === '' ) {
                                                                        $this->summary = $undoSummary;
                                                                } else {