Improved keyword sanitizer

pull/178/head
M66B 5 years ago
parent 0f14ee0fd2
commit 6646fb4567

@ -54,6 +54,7 @@ import java.net.IDN;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.text.Normalizer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
@ -2063,7 +2064,9 @@ public class MessageHelper {
continue; continue;
sb.append(kar); sb.append(kar);
} }
return sb.toString();
return Normalizer.normalize(sb.toString(), Normalizer.Form.NFKD)
.replaceAll("[^\\p{ASCII}]", "");
} }
static String sanitizeEmail(String email) { static String sanitizeEmail(String email) {

Loading…
Cancel
Save