mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Hard-deprecate too many params
Bug: T230803 Change-Id: Icec8bcb8ab23956654857acc8b3d235889f587a9
This commit is contained in:
parent
91bc961712
commit
f7ac35d5c6
|
@ -758,11 +758,21 @@ class AFPTreeParser {
|
|||
[ $func, $min, count( $args ) ]
|
||||
);
|
||||
} elseif ( count( $args ) > $max ) {
|
||||
$this->logger->warning(
|
||||
"Too many params to $func for filter: " . ( $this->mFilter ?? 'unavailable' )
|
||||
);
|
||||
if ( $this->mFilter !== null ) {
|
||||
$this->logger->warning(
|
||||
'DEPRECATED! Too many params passed to function `{func}`: got {actual_count}, ' .
|
||||
'expected {max_count} when parsing filter: {filter}. This is deprecated since ' .
|
||||
'1.34 and support will cease as of 1.35. Please fix the affected filter!',
|
||||
[
|
||||
'func' => $func,
|
||||
'actual_count' => count( $args ),
|
||||
'max_count' => $max,
|
||||
'filter' => $this->mFilter
|
||||
]
|
||||
);
|
||||
}
|
||||
/*
|
||||
@todo Uncomment after fixing filters in WMF production
|
||||
@todo Uncomment in 1.35/36
|
||||
throw new AFPUserVisibleException(
|
||||
'toomanyargs',
|
||||
$this->mCur->pos,
|
||||
|
|
|
@ -1213,11 +1213,21 @@ class AbuseFilterParser {
|
|||
[ $func, $min, count( $args ) ]
|
||||
);
|
||||
} elseif ( count( $args ) > $max ) {
|
||||
$this->logger->warning(
|
||||
"Too many params to $func for filter: " . ( $this->mFilter ?? 'unavailable' )
|
||||
);
|
||||
if ( $this->mFilter !== null ) {
|
||||
$this->logger->warning(
|
||||
'DEPRECATED! Too many params passed to function `{func}`: got {actual_count}, ' .
|
||||
'expected {max_count} when parsing filter: {filter}. This is deprecated since ' .
|
||||
'1.34 and support will cease as of 1.35. Please fix the affected filter!',
|
||||
[
|
||||
'func' => $func,
|
||||
'actual_count' => count( $args ),
|
||||
'max_count' => $max,
|
||||
'filter' => $this->mFilter
|
||||
]
|
||||
);
|
||||
}
|
||||
/*
|
||||
@todo Uncomment after fixing filters in WMF production
|
||||
@todo Uncomment in 1.35/36
|
||||
throw new AFPUserVisibleException(
|
||||
'toomanyargs',
|
||||
$this->mCur->pos,
|
||||
|
|
Loading…
Reference in a new issue