Changeset 8091
- Timestamp:
- 12/14/11 16:01:54 (18 months ago)
- Location:
- luci/trunk/libs/web
- Files:
-
- 2 modified
-
htdocs/luci-static/resources/cbi.js (modified) (1 diff)
-
luasrc/cbi/datatypes.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/web/htdocs/luci-static/resources/cbi.js
r7530 r8091 152 152 153 153 'hostname': function(v) 154 { if ( v.length <= 253 ) 155 return (v.match(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*[a-zA-Z0-9]$/) != null); 154 { 155 if (v.length <= 253) 156 return (v.match(/^[a-zA-Z0-9]+$/) != null || 157 v.match(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*[a-zA-Z0-9]$/) != null); 156 158 157 159 return false; -
luci/trunk/libs/web/luasrc/cbi/datatypes.lua
r7458 r8091 142 142 143 143 function hostname(val) 144 if val and (#val < 254) and val.match(val, "^[a-zA-Z0-9][a-zA-Z0-9%-%.]*[a-zA-Z0-9]$") then 144 if val and (#val < 254) and ( 145 val:match("^[a-zA-Z0-9]+$") or 146 val:match("^[a-zA-Z0-9][a-zA-Z0-9%-%.]*[a-zA-Z0-9]$") 147 ) then 145 148 return true 146 149 end
