RollbackAction/SpecialUndelete: Use OutputPage::addWikiMsg() where possible
authorC. Scott Ananian <cscott@cscott.net>
Fri, 26 Oct 2018 17:03:19 +0000 (13:03 -0400)
committerC. Scott Ananian <cananian@wikimedia.org>
Fri, 26 Oct 2018 17:09:01 +0000 (17:09 +0000)
Gently discourage the unnecessary use of OutputPage::addHTML().

Change-Id: Ibb33c056dee2344e9a7a5955408eb56c753acb7b

includes/actions/RollbackAction.php
includes/specials/SpecialUndelete.php

index 7b41262..c962e20 100644 (file)
@@ -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() )
+                                               )
+                                       );
                                }
                        }
 
index a93dec0..15b8054 100644 (file)
@@ -443,8 +443,12 @@ class SpecialUndelete extends SpecialPage {
                        }
                }
 
-               $out->addHTML( $this->msg( 'undelete-revision' )->rawParams( $link )->params(
-                       $time )->rawParams( $userLink )->params( $d, $t )->parse() . '</div>' );
+               $out->addWikiMsg(
+                       'undelete-revision',
+                       Message::rawParam( $link ), $time,
+                       Message::rawParam( $userLink ), $d, $t
+               );
+               $out->addHtml( '</div>' );
 
                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' ) );
                }