From 7a0a6321f2eb83f37859b538b06f407794522199 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Thu, 13 Dec 2018 04:05:26 +0200 Subject: [PATCH] allow domain name label to start with a digit --- app/src/main/kotlin/com/tutpro/baresip/Utils.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt index 574c3f28..698563c0 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt @@ -149,8 +149,8 @@ object Utils { fun checkDomain(domain: String): Boolean { val parts = domain.split(".") for (p in parts) { - if ((p.length == 0) || p.endsWith("-") || - !Regex("^[a-zA-z]([-a-zA-Z0-9])*\$").matches(p)) + if (p.endsWith("-") || p.startsWith("-") || + !Regex("^[-a-zA-Z0-9]+\$").matches(p)) return false } return true