From f938f15bea1a27f098fc7a0f93673adba31d2efe Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Fri, 8 Dec 2017 11:46:58 -0500 Subject: [PATCH] ApiQueryBase: Fix addWhereFld for PHP 7.2 Idfe23a07d didn't go far enough with this method, it can be passed arbitrary other scalars in addition to null and arrays. Bug: T182377 Change-Id: I63ec23f70d6d7ad638aa382b740ec44d0ca47f85 --- includes/api/ApiQueryBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 8e9b1b4973..179e6f7b25 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -262,7 +262,7 @@ abstract class ApiQueryBase extends ApiBase { * @param string|string[] $value Value; ignored if null or empty array; */ protected function addWhereFld( $field, $value ) { - if ( $value !== null && count( $value ) ) { + if ( $value !== null && !( is_array( $value ) && !$value ) ) { $this->where[$field] = $value; } } -- 2.20.1