From efecca619d2659d0080bf64adc147921e024b0d3 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 26 Oct 2018 13:03:19 -0400 Subject: [PATCH] RollbackAction/SpecialUndelete: Use OutputPage::addWikiMsg() where possible Gently discourage the unnecessary use of OutputPage::addHTML(). Change-Id: Ibb33c056dee2344e9a7a5955408eb56c753acb7b --- includes/actions/RollbackAction.php | 8 ++++++-- includes/specials/SpecialUndelete.php | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php index 7b4126278c..c962e20d22 100644 --- a/includes/actions/RollbackAction.php +++ b/includes/actions/RollbackAction.php @@ -101,8 +101,12 @@ class RollbackAction extends FormlessAction { $current = $data['current']; if ( $current->getComment() != '' ) { - $this->getOutput()->addHTML( $this->msg( 'editcomment' )->rawParams( - Linker::formatComment( $current->getComment() ) )->parse() ); + $this->getOutput()->addWikiMsg( + 'editcomment', + Message::rawParam( + Linker::formatComment( $current->getComment() ) + ) + ); } } diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index a93dec0313..15b8054af2 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -443,8 +443,12 @@ class SpecialUndelete extends SpecialPage { } } - $out->addHTML( $this->msg( 'undelete-revision' )->rawParams( $link )->params( - $time )->rawParams( $userLink )->params( $d, $t )->parse() . '' ); + $out->addWikiMsg( + 'undelete-revision', + Message::rawParam( $link ), $time, + Message::rawParam( $userLink ), $d, $t + ); + $out->addHtml( '' ); if ( !Hooks::run( 'UndeleteShowRevision', [ $this->mTargetObj, $rev ] ) ) { return; @@ -1169,7 +1173,7 @@ class SpecialUndelete extends SpecialPage { } $link = $this->getLinkRenderer()->makeKnownLink( $this->mTargetObj ); - $out->addHTML( $this->msg( 'undeletedpage' )->rawParams( $link )->parse() ); + $out->addWikiMsg( 'undeletedpage', Message::rawParam( $link ) ); } else { $out->setPageTitle( $this->msg( 'undelete-error' ) ); } -- 2.20.1