Explicitly format Message oject instead of string cast

The implicit in Mesage::__toString, as called when the object
is accepted by a method that needs a string, is to format
with parse(). Call that explicitly instead, or use escaped()
in places where it seems like elaborate wikitext isn't expected.

Change-Id: I9f1de3a0047d1f26d30c8607a0a79543d166176f
This commit is contained in:
Umherirrender 2020-05-23 23:49:32 +02:00
parent 6693267e57
commit 4f269d67b8
3 changed files with 4 additions and 4 deletions

View file

@ -163,7 +163,7 @@ class ToolbarBuilder {
$entry = new SingleMenuEntry(
'page-actions-contributions',
$label,
$label->escaped(),
SpecialPage::getTitleFor( 'Contributions', $user->getName() )->getLocalURL() );
$entry->setTitle( $label )
->trackClicks( 'contributions' )
@ -199,7 +199,7 @@ class ToolbarBuilder {
$entry = new SingleMenuEntry(
'page-actions-edit',
$this->messageLocalizer->msg( 'mobile-frontend-editor-edit' ),
$this->messageLocalizer->msg( 'mobile-frontend-editor-edit' )->escaped(),
$title->getLocalURL( $editArgs ),
'edit-page'
);

View file

@ -175,7 +175,7 @@ class MinervaHooks {
$enhanced = $request->getBool( 'enhanced', $isEnhancedDefaultForUser );
if ( $enhanced ) {
$out->addHTML( Html::warningBox(
$special->msg( 'skin-minerva-recentchanges-warning-enhanced-not-supported' )
$special->msg( 'skin-minerva-recentchanges-warning-enhanced-not-supported' )->parse()
) );
}
break;

View file

@ -257,7 +257,7 @@ class MinervaTemplate extends BaseTemplate {
'class' => MinervaUI::iconClass(
'search-base20', 'element', 'skin-minerva-search-trigger', 'wikimedia'
)
], wfMessage( 'searchbutton' ) ),
], wfMessage( 'searchbutton' )->escaped() ),
'userNotificationsHTML' => $data['userNotificationsHTML'] ?? '',
'data-main-menu' => $this->getMainMenuData( $data ),
'hasheadingholder' => $hasHeadingHolder,