mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-23 15:57:03 +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,8 +454,10 @@ class SpecialNuke extends SpecialPage {
|
|||
if ( $username === '' ) {
|
||||
$queryBuilder->field( 'actor_name', 'rc_user_text' );
|
||||
} else {
|
||||
$actornames = [ $username, ...$tempnames ];
|
||||
$queryBuilder->andWhere( [ 'actor_name' => $actornames ] );
|
||||
$actornames = array_filter( [ $username, ...$tempnames ] );
|
||||
if ( $actornames ) {
|
||||
$queryBuilder->andWhere( [ 'actor_name' => $actornames ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $namespace !== null ) {
|
||||
|
|
Loading…
Reference in a new issue