X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBase.php;h=179e6f7b2512d16ecc60c95541c200d10daf307f;hp=051d346f1ccaf7e0083b0412d3f68ec857d315b9;hb=f938f15bea1a27f098fc7a0f93673adba31d2efe;hpb=bd2883903db18bec94c684edc6e6498a2612ac3d diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 051d346f1c..179e6f7b25 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -119,7 +119,7 @@ abstract class ApiQueryBase extends ApiBase { * See ApiQuery::getNamedDB() for more information * @param string $name Name to assign to the database connection * @param int $db One of the DB_* constants - * @param array $groups Query groups + * @param string|string[] $groups Query groups * @return IDatabase */ public function selectNamedDB( $name, $db, $groups ) { @@ -262,9 +262,7 @@ abstract class ApiQueryBase extends ApiBase { * @param string|string[] $value Value; ignored if null or empty array; */ protected function addWhereFld( $field, $value ) { - // Use count() to its full documented capabilities to simultaneously - // test for null, empty array or empty countable object - if ( count( $value ) ) { + if ( $value !== null && !( is_array( $value ) && !$value ) ) { $this->where[$field] = $value; } }