mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-01 09:06:22 +00:00
7c1d1c6d7d
This commit introduces some boilerplate for emitting warnings from the AbuseFilter parser, and also code for showing these warnings in the ace editor. Adding new warnings should be as simple as appending to AbuseFilterParser::warnings (and adding the relevant i18n). Bug: T264768 Bug: T269770 Change-Id: Ic11021b379f997a89f59c8c0572338d957e089a6
23 lines
467 B
PHP
23 lines
467 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Parser;
|
|
|
|
use Message;
|
|
|
|
/**
|
|
* A variant of user-visible exception that is not fatal.
|
|
*/
|
|
class UserVisibleWarning extends AFPUserVisibleException {
|
|
/**
|
|
* @return Message
|
|
*/
|
|
public function getMessageObj() {
|
|
// Give grep a chance to find the usages:
|
|
// abusefilter-warning-match-empty-regex
|
|
return wfMessage(
|
|
'abusefilter-warning-' . $this->mExceptionID,
|
|
$this->mPosition, ...$this->mParams
|
|
);
|
|
}
|
|
}
|