From 0923015f4acc4bb767f9f80ea288113bbd6f6efc Mon Sep 17 00:00:00 2001 From: Kosta Harlan Date: Mon, 21 Oct 2024 16:09:15 +0200 Subject: [PATCH] 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 --- includes/SpecialNuke.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/SpecialNuke.php b/includes/SpecialNuke.php index ccb952ec..cd6fd76e 100644 --- a/includes/SpecialNuke.php +++ b/includes/SpecialNuke.php @@ -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 ) {