From c5811d52d0dbcf059418462ae983aaa09aa076b5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 14 Dec 2011 15:01:54 +0000 Subject: libs/web: allow one-character hostnames --- libs/web/htdocs/luci-static/resources/cbi.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/web/htdocs/luci-static/resources') diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index 5eee59c347..123e8e1aba 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -151,8 +151,10 @@ var cbi_validators = { }, 'hostname': function(v) - { if ( v.length <= 253 ) - return (v.match(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*[a-zA-Z0-9]$/) != null); + { + if (v.length <= 253) + return (v.match(/^[a-zA-Z0-9]+$/) != null || + v.match(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*[a-zA-Z0-9]$/) != null); return false; }, -- cgit v1.2.3