From: Brad Jorsch Date: Fri, 8 Dec 2017 16:46:58 +0000 (-0500) Subject: ApiQueryBase: Fix addWhereFld for PHP 7.2 X-Git-Tag: 1.31.0-rc.0~1243^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=f938f15bea1a27f098fc7a0f93673adba31d2efe;hp=370bd11d455e24eec056f518601bc197ecac4c30 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 --- 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; } }