diff options
author | Tim Starling <tstarling@wikimedia.org> | 2024-03-19 20:34:55 +1100 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2024-03-19 20:34:55 +1100 |
commit | 51bceb0fafa9e4b05473347d3369f9b1a2ae9a96 (patch) | |
tree | d9ccc29cc97983d6a1d99b5176e640d5a437e881 /includes/api/ApiQueryBlocks.php | |
parent | 873346377d9a81de68459f13d964b71e4a1ff40d (diff) | |
download | mediawikicore-51bceb0fafa9e4b05473347d3369f9b1a2ae9a96.tar.gz mediawikicore-51bceb0fafa9e4b05473347d3369f9b1a2ae9a96.zip |
block: Fix exception in ApiQueryBlocks when specified users are not blocked
Fix exception due to empty array passed to makeList() for bt_id.
Bug: T360088
Change-Id: I1336923976aae02bb4a4013c2cefa0a3629bc99a
Diffstat (limited to 'includes/api/ApiQueryBlocks.php')
-rw-r--r-- | includes/api/ApiQueryBlocks.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index db30a12b3750..5591017a0c4f 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -224,7 +224,11 @@ class ApiQueryBlocks extends ApiQueryBase { ) ->caller( __METHOD__ ) ->fetchFieldValues(); - $this->addWhere( [ 'bt_id' => $ids ] ); + if ( $ids ) { + $this->addWhere( [ 'bt_id' => $ids ] ); + } else { + $this->addWhere( '1=0' ); + } } elseif ( $addresses ) { $this->addWhere( [ 'bt_address' => $addresses ] ); } elseif ( $userNames ) { |