case 'badaccess':
throw new PermissionsError( 'sendemail' );
case 'blockedemailuser':
- throw new UserBlockedError( $this->getUser()->mBlock );
+ throw $this->getBlockedEmailError();
case 'actionthrottledtext':
throw new ThrottledError;
case 'mailnologin':
if ( $data['CCMe'] && $to != $from ) {
$ccTo = $from;
$ccFrom = $from;
- $ccSubject = $context->msg( 'emailccsubject' )->rawParams(
+ $ccSubject = $context->msg( 'emailccsubject' )->plaintextParams(
$target->getName(), $subject )->text();
$ccText = $text;
protected function getGroupName() {
return 'users';
}
+
+ /**
+ * Builds an error message based on the block params
+ *
+ * @return ErrorPageError
+ */
+ private function getBlockedEmailError() {
+ $block = $this->getUser()->mBlock;
+ $params = $block->getBlockErrorParams( $this->getContext() );
+
+ $msg = $block->isSitewide() ? 'blockedtext' : 'blocked-email-user';
+ return new ErrorPageError( 'blockedtitle', $msg, $params );
+ }
}