forked from External/mage
Fixed admin pswd not always parsed correctly on server
This commit is contained in:
parent
e67620260c
commit
ef6d5e826e
2 changed files with 18 additions and 0 deletions
|
|
@ -148,4 +148,20 @@ public class SystemUtil {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String sanitize(String input) {
|
||||
//Pattern pattern = Pattern.compile("[^0-9a-zA-Z]");
|
||||
//Matcher matcher = pattern.matcher(input);
|
||||
//return matcher.replaceAll("");
|
||||
return input.replaceAll("[^a-zA-Z0-9]", "");
|
||||
}
|
||||
|
||||
public static void main(String... args) {
|
||||
System.out.println(sanitize("123"));
|
||||
System.out.println(sanitize("AaAaD_123"));
|
||||
System.out.println(sanitize("--sas-"));
|
||||
System.out.println(sanitize("anPlsdf123_") + "|");
|
||||
System.out.println(sanitize("anPlsdf123 ") + "|");
|
||||
System.out.println(sanitize("anPlsdf123\r\n") + "|");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue