BugFix for too long Usernames.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1642 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 9d6bae77ee
commit b137c90015

@ -127,6 +127,9 @@ public final class userDB {
} }
public Entry getEntry(String userName) { public Entry getEntry(String userName) {
if(userName.length()>128){
userName=userName.substring(128);
}
try { try {
Map record = userTable.get(userName); Map record = userTable.get(userName);
if (record == null) return null; if (record == null) return null;
@ -269,7 +272,10 @@ public final class userDB {
public Entry(String userName, Map mem) { public Entry(String userName, Map mem) {
if ((userName == null) || (userName.length() == 0)) if ((userName == null) || (userName.length() == 0))
throw new IllegalArgumentException(); throw new IllegalArgumentException("Username needed.");
if(userName.length()>128){
throw new IllegalArgumentException("Username too long!");
}
this.userName = userName.trim(); this.userName = userName.trim();
if (this.userName.length() < USERNAME_MIN_LENGTH) if (this.userName.length() < USERNAME_MIN_LENGTH)

Loading…
Cancel
Save