summaryrefslogtreecommitdiffhomepage
path: root/libs/web/htdocs/luci-static/resources/cbi.js
diff options
context:
space:
mode:
Diffstat (limited to 'libs/web/htdocs/luci-static/resources/cbi.js')
-rw-r--r--libs/web/htdocs/luci-static/resources/cbi.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js
index 5eee59c34..123e8e1ab 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;
},