1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-26 10:52:16 -05:00

AddServerActivity: Fixed username regex - allow "-" in nicknames

This commit is contained in:
Sebastian Kaspari 2010-04-18 22:45:53 +02:00
parent f67594d85d
commit 826f06fb01

View File

@ -332,7 +332,7 @@ public class AddServerActivity extends Activity implements OnClickListener
// <special> ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'
// Chars that are not in RFC 1459 but are supported too:
// | and _
Pattern nickPattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9^-`\\[\\]{}|_\\\\]*$");
Pattern nickPattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9^\\-`\\[\\]{}|_\\\\]*$");
if (!nickPattern.matcher(nickname).matches()) {
throw new ValidationException("Invalid nickname");
}