mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-23 16:18:50 -05:00
Update the domain validator to accept ip addresses and "localhost"
This commit is contained in:
parent
171648aa41
commit
abd81a81c1
@ -88,6 +88,12 @@ public class Utility {
|
||||
if (s.matches("^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$")) {
|
||||
return true;
|
||||
}
|
||||
if (s.matches("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) {
|
||||
return true;
|
||||
}
|
||||
if ((s.equalsIgnoreCase("localhost"))||(s.equalsIgnoreCase("localhost.localdomain"))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user