mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Avoid Call Stack warning when there is an error in the regex pattern
When you are in Specia:AbuseFilter/test and you test a filter against RC if the filter has a regex with a rlike condition you receive a Call Stack warning for a wrong regex. Bug: T177744 Change-Id: I2bc62b5709d2863eb355a249610b3e80fab55448
This commit is contained in:
parent
a2ebd0c70a
commit
9eb99b1dc9
|
@ -231,7 +231,9 @@ class AFPData {
|
|||
$pattern .= 'i';
|
||||
}
|
||||
|
||||
MediaWiki\suppressWarnings();
|
||||
$result = preg_match( $pattern, $str );
|
||||
MediaWiki\restoreWarnings();
|
||||
if ( $result === false ) {
|
||||
throw new AFPUserVisibleException(
|
||||
'regexfailure',
|
||||
|
|
Loading…
Reference in a new issue