mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-27 15:30:48 +00:00
Replace usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: I601cf8d513bd1bbd305c6ad2250ba18b376fe819
This commit is contained in:
parent
efca55077c
commit
b9b82c550f
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use Wikimedia\AtEase\AtEase;
|
||||
|
||||
/**
|
||||
* @ingroup Extensions
|
||||
|
@ -337,13 +338,13 @@ class TitleBlacklist {
|
|||
public function validate( array $blacklist ) {
|
||||
$badEntries = [];
|
||||
foreach ( $blacklist as $e ) {
|
||||
Wikimedia\suppressWarnings();
|
||||
AtEase::suppressWarnings();
|
||||
$regex = $e->getRegex();
|
||||
// @phan-suppress-next-line SecurityCheck-ReDoS
|
||||
if ( preg_match( "/{$regex}/u", '' ) === false ) {
|
||||
$badEntries[] = $e->getRaw();
|
||||
}
|
||||
Wikimedia\restoreWarnings();
|
||||
AtEase::restoreWarnings();
|
||||
}
|
||||
return $badEntries;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
use MediaWiki\Extension\AntiSpoof\AntiSpoof;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use Wikimedia\AtEase\AtEase;
|
||||
|
||||
/**
|
||||
* @ingroup Extensions
|
||||
|
@ -130,13 +131,13 @@ class TitleBlacklistEntry {
|
|||
}
|
||||
}
|
||||
|
||||
Wikimedia\suppressWarnings();
|
||||
AtEase::suppressWarnings();
|
||||
// @phan-suppress-next-line SecurityCheck-ReDoS
|
||||
$match = preg_match(
|
||||
"/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ),
|
||||
$title
|
||||
);
|
||||
Wikimedia\restoreWarnings();
|
||||
AtEase::restoreWarnings();
|
||||
|
||||
if ( $match ) {
|
||||
if ( isset( $this->mParams['moveonly'] ) && $action != 'move' ) {
|
||||
|
|
Loading…
Reference in a new issue