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:
melos 2017-10-07 17:23:28 +02:00
parent a2ebd0c70a
commit 9eb99b1dc9

View file

@ -231,7 +231,9 @@ class AFPData {
$pattern .= 'i';
}
MediaWiki\suppressWarnings();
$result = preg_match( $pattern, $str );
MediaWiki\restoreWarnings();
if ( $result === false ) {
throw new AFPUserVisibleException(
'regexfailure',