mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-24 00:05:33 +00:00
SpecialNuke: Don't add actor names WHERE if no names supplied
Why: - If submitting the form with no conditions, the `$actornames` variable will be an array with a single empty string, which means the WHERE clause won't find any matches What: - Only add actor names to the WHERE clause if the array contains names to check Bug: T342785 Change-Id: I7f407695583c1d7ebaf81d116578bd336adc5c7f
This commit is contained in:
parent
98aa8d9942
commit
0923015f4a
|
@ -454,9 +454,11 @@ class SpecialNuke extends SpecialPage {
|
|||
if ( $username === '' ) {
|
||||
$queryBuilder->field( 'actor_name', 'rc_user_text' );
|
||||
} else {
|
||||
$actornames = [ $username, ...$tempnames ];
|
||||
$actornames = array_filter( [ $username, ...$tempnames ] );
|
||||
if ( $actornames ) {
|
||||
$queryBuilder->andWhere( [ 'actor_name' => $actornames ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $namespace !== null ) {
|
||||
$queryBuilder->andWhere( [ 'page_namespace' => $namespace ] );
|
||||
|
|
Loading…
Reference in a new issue