+ // Validate biolimit
+
+ if (!Validate::number($values['profile']['biolimit'])) {
+ // TRANS: Form validation error in user admin panel when a non-numeric character limit was set.
+ $this->clientError(_('Invalid bio limit. Must be numeric.'));
+ }
+
+ // Validate welcome text
+
+ if (mb_strlen($values['newuser']['welcome']) > 255) {
+ // TRANS: Form validation error in user admin panel when welcome text is too long.
+ $this->clientError(_('Invalid welcome text. Maximum length is 255 characters.'));
+ }
+
+ // Validate default subscription
+
+ if (!empty($values['newuser']['default'])) {
+ $defuser = User::staticGet('nickname', trim($values['newuser']['default']));
+ if (empty($defuser)) {
+ $this->clientError(
+ sprintf(
+ // TRANS: Client error displayed when trying to set a non-existing user as default subscription for new
+ // TRANS: users in user admin panel. %1$s is the invalid nickname.
+ _('Invalid default subscripton: "%1$s" is not a user.'),
+ $values['newuser']['default']
+ )
+ );
+ }
+ }