From 291c35cea0bd9082f49e848412bb5832c4c8f1c9 Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sat, 18 May 2019 10:55:26 +0200 Subject: [PATCH] Don't send empty array to Database::makeList Check that the provided param is not empty, as otherwise Database::makeList will throw and the exception will bubble up to the user. Bug: T222531 Change-Id: Icf5db25037a0d0a7b4076f21e7f1c9a6ee1d5a87 --- includes/api/ApiQueryAbuseLog.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryAbuseLog.php b/includes/api/ApiQueryAbuseLog.php index 1a18832e7..27b3be625 100644 --- a/includes/api/ApiQueryAbuseLog.php +++ b/includes/api/ApiQueryAbuseLog.php @@ -134,7 +134,10 @@ class ApiQueryAbuseLog extends ApiQueryBase { } } - $this->addWhereIf( [ 'afl_filter' => $params['filter'] ], isset( $params['filter'] ) ); + $this->addWhereIf( + [ 'afl_filter' => $params['filter'] ], + isset( $params['filter'] ) && $params['filter'] !== [] + ); $this->addWhereIf( [ 'afl_deleted' => 0 ], !SpecialAbuseLog::canSeeHidden() ); if ( isset( $params['wiki'] ) ) { // 'wiki' won't be set if $wgAbuseFilterIsCentral = false