Hard-deprecate too many params

Bug: T230803
Change-Id: Icec8bcb8ab23956654857acc8b3d235889f587a9
This commit is contained in:
Daimona Eaytoy 2019-09-16 16:02:33 +02:00
parent 91bc961712
commit f7ac35d5c6
2 changed files with 28 additions and 8 deletions

View file

@ -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,

View file

@ -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,