Loosen email validation
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
package eu.crushedpixel.replaymod.utils;
|
package eu.crushedpixel.replaymod.utils;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
|
|
||||||
public class EmailAddressUtils {
|
public class EmailAddressUtils {
|
||||||
public static boolean isValidEmailAddress(String mail) {
|
public static boolean isValidEmailAddress(String mail) {
|
||||||
try {
|
return mail.matches("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$");
|
||||||
String[] spl1 = mail.split("@");
|
|
||||||
return spl1[0].equals(URLEncoder.encode(spl1[0], "UTF-8")) && spl1[1].equals(URLEncoder.encode(spl1[1], "UTF-8"));
|
|
||||||
} catch(Exception e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user