Wrap error messages in Html::errorBox

The message 'abusefilter-edit-notallowed' is used twice and outputted
as plain text. This makes it really, really hard to notice. Wrap it in a
block-level errorbox to make sure users see it.

Change-Id: I6e5579f9a5e33f05520001e10ffdde928ffdcff0
This commit is contained in:
Daimona Eaytoy 2018-07-09 00:23:38 +02:00
parent cacc034d1a
commit 9012848032

View file

@ -46,7 +46,13 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$this->exposeWarningMessages();
if ( $filter == 'new' && !$this->canEdit() ) {
$out->addWikiMsg( 'abusefilter-edit-notallowed' );
$out->addHTML(
Xml::tags(
'p',
null,
Html::errorBox( $this->msg( 'abusefilter-edit-notallowed' )->parse() )
)
);
return;
}
@ -92,7 +98,13 @@ class AbuseFilterViewEdit extends AbuseFilterView {
} else {
if ( $tokenMatches ) {
// Lost rights meanwhile
$out->addWikiMsg( 'abusefilter-edit-notallowed' );
$out->addHTML(
Xml::tags(
'p',
null,
Html::errorBox( $this->msg( 'abusefilter-edit-notallowed' )->parse() )
)
);
}
if ( $history_id ) {