use MediaWiki\Linker\LinkTarget;
use Wikimedia\Assert\Assert;
+use Wikimedia\Rdbms\LoadBalancer;
/**
* Class performing complex database queries related to WatchedItems.
$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 [];
}