merge with issue-470

This commit is contained in:
Sebastian Sdorra
2013-10-28 13:19:16 +01:00
3 changed files with 17 additions and 41 deletions

View File

@@ -55,16 +55,13 @@ public final class ValidationUtil
"^[A-z0-9][\\w.-]*@[A-z0-9][\\w\\-\\.]+\\.[A-z0-9]{2,6}$";
/** Field description */
private static final String REGEX_NAME = "^[A-z0-9\\.\\-_]+$";
private static final String REGEX_NAME =
"^[A-z0-9\\.\\-_@]|[^ ]([A-z0-9\\.\\-_@ ]*[A-z0-9\\.\\-_@]|[^ ])?$";
/** Field description */
private static final String REGEX_REPOSITORYNAME =
"(?!^\\.\\.$)(?!^\\.$)(?!.*[\\\\\\[\\]])^[A-z0-9\\.][A-z0-9\\.\\-_/]*$";
/** Field description */
private static final String REGEX_USERNAME =
"^[A-z0-9\\.\\-_@]|[^ ]([A-z0-9\\.\\-_@ ]*[A-z0-9\\.\\-_@]|[^ ])?$";
//~--- constructors ---------------------------------------------------------
/**
@@ -185,10 +182,12 @@ public final class ValidationUtil
* @param username
*
* @return
* @deprecated use {@link #isNameValid(String)}
*/
@Deprecated
public static boolean isUsernameValid(String username)
{
return Util.isNotEmpty(username) && username.matches(REGEX_USERNAME);
return isNameValid(username);
}
/**