$ownersToken = $watchlistOwner->getOption( 'watchlisttoken' );
$token = $options['watchlistOwnerToken'];
if ( $ownersToken == '' || !hash_equals( $ownersToken, $token ) ) {
- throw new UsageException(
- 'Incorrect watchlist token provided -- please set a correct token in Special:Preferences',
- 'bad_wltoken'
- );
+ throw ApiUsageException::newWithMessage( null, 'apierror-bad-watchlist-token', 'bad_wltoken' );
}
return $watchlistOwner->getId();
}
}
private function getStartEndConds( IDatabase $db, array $options ) {
- if ( !isset( $options['start'] ) && ! isset( $options['end'] ) ) {
+ if ( !isset( $options['start'] ) && !isset( $options['end'] ) ) {
return [];
}