mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Use modern str_starts_with() and [ ... ] syntax
Change-Id: I2f2182e1e0850d7ebf832b7b8e0630ce56aad88b
This commit is contained in:
parent
6bdde6553b
commit
c9f8343173
|
@ -64,7 +64,7 @@ class UserVisibleException extends ExceptionBase {
|
|||
// abusefilter-exception-unknownfunction, abusefilter-exception-usebuiltin
|
||||
return new Message(
|
||||
'abusefilter-exception-' . $this->mExceptionID,
|
||||
array_merge( [ $this->mPosition ], $this->mParams )
|
||||
[ $this->mPosition, ...$this->mParams ]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class UserVisibleWarning extends UserVisibleException {
|
|||
// abusefilter-parser-warning-match-empty-regex
|
||||
return new Message(
|
||||
'abusefilter-parser-warning-' . $this->mExceptionID,
|
||||
array_merge( [ $this->mPosition ], $this->mParams )
|
||||
[ $this->mPosition, ...$this->mParams ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ class LazyVariableComputer {
|
|||
// this inference is ugly, but the name isn't accessible from here
|
||||
// and we only want this for debugging
|
||||
$textVar = $parameters['text-var'];
|
||||
$varName = strpos( $textVar, 'old_' ) === 0 ? 'old_links' : 'all_links';
|
||||
$varName = str_starts_with( $textVar, 'old_' ) ? 'old_links' : 'all_links';
|
||||
if ( $parameters['forFilter'] ?? false ) {
|
||||
$this->logger->debug( "Loading $varName from DB" );
|
||||
$links = $this->getLinksFromDB( $article );
|
||||
|
|
Loading…
Reference in a new issue