Nickname::normalize now checks for path name collision too.

This commit is contained in:
Mikael Nordfeldth 2013-10-16 13:22:43 +02:00
parent 352bef2374
commit b764ee8134

View File

@ -118,6 +118,9 @@ class Nickname
if (!self::isCanonical($str)) {
throw new NicknameInvalidException();
}
if (!User::allowed_nickname($str)) {
throw new NicknameBlacklistException();
}
return $str;
}
@ -194,3 +197,12 @@ class NicknameTooLongException extends NicknameInvalidException
Nickname::MAX_LEN);
}
}
class NicknameBlacklistException extends NicknameInvalidException
{
protected function defaultMessage()
{
// TRANS: Validation error in form for registration, profile and group settings, etc.
return _('Nickname is disallowed through blacklist or system path list.');
}
}