Fix "PHP Warning: count(): Parameter must be an array or an object that implements Countable"

Change-Id: I6169f4226acd41c77d0b4b7710064dce45761bbd
This commit is contained in:
Paladox 2018-07-07 23:34:43 +00:00
parent fc59da2cca
commit bacee60d42

View file

@ -32,7 +32,7 @@ class ApiEchoMarkRead extends ApiBase {
}
// Mark as unread
if ( count( $params['unreadlist'] ) > 0 ) {
if ( $params['unreadlist'] !== null && $params['unreadlist'] !== [] ) {
// Make sure there is a limit to the update
$notifUser->markUnRead( array_slice( $params['unreadlist'], 0, ApiBase::LIMIT_SML2 ) );
}