summaryrefslogtreecommitdiffhomepage
path: root/libs/web/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-12-14 15:01:54 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-12-14 15:01:54 +0000
commitc5811d52d0dbcf059418462ae983aaa09aa076b5 (patch)
tree1a16dd8d91e155ba0314d52980bd42168df09661 /libs/web/htdocs/luci-static/resources
parent3bccd252811bde56656fd23719a9c6122e4e42ca (diff)
libs/web: allow one-character hostnames
Diffstat (limited to 'libs/web/htdocs/luci-static/resources')
-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 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;
},