mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Make use of PHP's list() feature where possible"
This commit is contained in:
commit
915bea466e
|
@ -205,8 +205,7 @@ class AbuseFilterHooks {
|
|||
$warning = $warning->inContentLanguage();
|
||||
}
|
||||
|
||||
$filterDescription = $params[0];
|
||||
$filter = $params[1];
|
||||
list( $filterDescription, $filter ) = $params;
|
||||
|
||||
// The value is a nested structure keyed by filter id, which doesn't make sense when we only
|
||||
// return the result from one filter. Flatten it to a plain array of actions.
|
||||
|
|
|
@ -793,9 +793,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
case 'block':
|
||||
if ( $set && count( $parameters ) === 3 ) {
|
||||
// Both blocktalk and custom block durations available
|
||||
$blockTalk = $parameters[0];
|
||||
$defaultAnonDuration = $parameters[1];
|
||||
$defaultUserDuration = $parameters[2];
|
||||
list( $blockTalk, $defaultAnonDuration, $defaultUserDuration ) = $parameters;
|
||||
} else {
|
||||
if ( $set && count( $parameters ) === 1 ) {
|
||||
// Only blocktalk available
|
||||
|
|
|
@ -170,8 +170,7 @@ class AbuseFilterTokenizer {
|
|||
|
||||
// Numbers
|
||||
if ( preg_match( self::RADIX_RE, $code, $matches, 0, $offset ) ) {
|
||||
$token = $matches[0];
|
||||
$input = $matches[1];
|
||||
list( $token, $input ) = $matches;
|
||||
$baseChar = $matches[2] ?? null;
|
||||
// Sometimes the base char gets mixed in with the rest of it because
|
||||
// the regex targets hex, too.
|
||||
|
|
Loading…
Reference in a new issue