From 1f32729428b4a859399c03efd255d7ae61a7b2b8 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Tue, 22 Oct 2024 22:33:00 +0200 Subject: [PATCH] luci-base: allow terminal '.' in hostname checks allowed in hostnames to represent the root of the DNS hierarchy Signed-off-by: Paul Donald --- modules/luci-base/htdocs/luci-static/resources/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index 5719031cb7..87f5f4b42c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -394,7 +394,7 @@ var ValidatorFactory = baseclass.extend({ if (this.value.length <= 253) return this.assert( (this.value.match(/^[a-zA-Z0-9_]+$/) != null || - (this.value.match(/^[a-zA-Z0-9_][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$/) && + (this.value.match(/^[a-zA-Z0-9_][a-zA-Z0-9_\-.]*[a-zA-Z0-9]\.?$/) && this.value.match(/[^0-9.]/))) && (!strict || !this.value.match(/^_/)), _('valid hostname')); -- 2.30.2