Show syntax error message in an error box on Special:AbuseFilter/test

Otherwise it's barely noticable.

Change-Id: Iff10036996c9e190c850d0b24f3ea0817624b95f
This commit is contained in:
Matěj Suchánek 2022-06-30 09:40:47 +02:00
parent 60e03c965e
commit 3b5b3cbae7

View file

@ -2,6 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\View;
use Html;
use HTMLForm;
use IContextSource;
use LogEventsList;
@ -217,7 +218,9 @@ class AbuseFilterViewTestBatch extends AbuseFilterView {
$ruleChecker = $this->ruleCheckerFactory->newRuleChecker();
if ( !$ruleChecker->checkSyntax( $this->testPattern )->isValid() ) {
$out->addWikiMsg( 'abusefilter-test-syntaxerr' );
$out->addHTML(
Html::errorBox( $this->msg( 'abusefilter-test-syntaxerr' )->parse() )
);
return;
}