# 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 {
'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.',
'undo-norev' => 'The edit could not be undone because it does not exist or was deleted.',
'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]])',
+'undo-summary-username-hidden' => 'Undo revision $1 by a hidden user',
# Account creation failure
'cantcreateaccounttitle' => 'Cannot create account',
{{Identical|Undo}}',
'undo-summary' => 'Edit summary for an undo action.{{Identical|Undo}}',
+'undo-summary-username-hidden' => 'Edit summary for an undo action where the username of the old revision is hidden.
+$1 is the revision ID being undone',
# Account creation failure
'cantcreateaccounttitle' => 'Used as title of the error message {{msg-mw|Cantcreateaccount-text}}.',
'undo-failure',
'undo-norev',
'undo-summary',
+ 'undo-summary-username-hidden',
),
'cantcreateaccount' => array(
'cantcreateaccounttitle',