mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
SubscriptionStore: Allow empty array to be passed to fetchSubscriptions
Change-Id: Ib2b659645ed55bc7a64f9971f0e054907c86a552
This commit is contained in:
parent
c618139b9c
commit
11d40d2663
|
@ -8,6 +8,7 @@ use MediaWiki\User\UserIdentity;
|
||||||
use ReadOnlyMode;
|
use ReadOnlyMode;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use TitleValue;
|
use TitleValue;
|
||||||
|
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||||
use Wikimedia\Rdbms\IDatabase;
|
use Wikimedia\Rdbms\IDatabase;
|
||||||
use Wikimedia\Rdbms\ILBFactory;
|
use Wikimedia\Rdbms\ILBFactory;
|
||||||
use Wikimedia\Rdbms\ILoadBalancer;
|
use Wikimedia\Rdbms\ILoadBalancer;
|
||||||
|
@ -75,6 +76,11 @@ class SubscriptionStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $itemNames !== null ) {
|
if ( $itemNames !== null ) {
|
||||||
|
if ( !count( $itemNames ) ) {
|
||||||
|
// We are not allowed to construct a filter with an empty array.
|
||||||
|
// Any empty array should result in no items being returned.
|
||||||
|
return new FakeResultWrapper( [] );
|
||||||
|
}
|
||||||
$conditions[ 'sub_item' ] = $itemNames;
|
$conditions[ 'sub_item' ] = $itemNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue