allow domain name label to start with a digit
This commit is contained in:
@@ -149,8 +149,8 @@ object Utils {
|
|||||||
fun checkDomain(domain: String): Boolean {
|
fun checkDomain(domain: String): Boolean {
|
||||||
val parts = domain.split(".")
|
val parts = domain.split(".")
|
||||||
for (p in parts) {
|
for (p in parts) {
|
||||||
if ((p.length == 0) || p.endsWith("-") ||
|
if (p.endsWith("-") || p.startsWith("-") ||
|
||||||
!Regex("^[a-zA-z]([-a-zA-Z0-9])*\$").matches(p))
|
!Regex("^[-a-zA-Z0-9]+\$").matches(p))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user