$user = $this->getUser();
// make sure the user is allowed
- if ( !$user->isAllowed( 'changetags' ) ) {
- $this->dieUsage( "You don't have permission to add or remove change tags from individual edits",
- 'permissiondenied' );
- }
+ $this->checkUserRightsAny( 'changetags' );
if ( $user->isBlocked() ) {
$this->dieBlocked( $user->getBlock() );
}
protected static function validateLogId( $logid ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->selectField( 'logging', 'log_id', [ 'log_id' => $logid ],
__METHOD__ );
return (bool)$result;
if ( !$valid ) {
$idResult['status'] = 'error';
- $idResult += $this->parseMsg( [ "nosuch$type", $id ] );
+ // Messages: apierror-nosuchrcid apierror-nosuchrevid apierror-nosuchlogid
+ $idResult += $this->getErrorFormatter()->formatMessage( [ "apierror-nosuch$type", $id ] );
return $idResult;
}