X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fweb%2Fhtdocs%2Fluci-static%2Fresources%2Fcbi.js;h=123e8e1aba77f293107aff30acb2688c5759d929;hp=5eee59c347fb3e2008b125dc6f83d7e4faa54487;hb=c5811d52d0dbcf059418462ae983aaa09aa076b5;hpb=737daee3e16a6ce3ec93446ba5e36554df5a7e82 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; },