X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBase.php;h=84169cb843a866eb590d189a2a7dc63c4255a0f2;hb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd;hp=6987dfb13fa9b2a91a19dc07f47b291ac373f571;hpb=af09cc10883257b872308729b04242b0fe8e2fb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 6987dfb13f..84169cb843 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -259,12 +255,10 @@ abstract class ApiQueryBase extends ApiBase { /** * Equivalent to addWhere(array($field => $value)) * @param string $field Field name - * @param string|string[] $value Value; ignored if null or empty array; + * @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; } } @@ -457,7 +451,7 @@ abstract class ApiQueryBase extends ApiBase { 'ipb_expiry', 'ipb_timestamp' ] ); - $commentQuery = CommentStore::newKey( 'ipb_reason' )->getJoin(); + $commentQuery = CommentStore::getStore()->getJoin( 'ipb_reason' ); $this->addTables( $commentQuery['tables'] ); $this->addFields( $commentQuery['fields'] ); $this->addJoinConds( $commentQuery['joins'] );