summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/cbi
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-10-30 18:12:39 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-10-30 18:12:39 +0000
commit46222415352ac3b5a99570178a4ed46b759c2e82 (patch)
treefa3ca0e26071a64816e9aa10fcfebefb62e38714 /libs/web/luasrc/cbi
parentfc5b9e27f0bdc9483f88f368bf3a3090c63bbd39 (diff)
libs/web: introduce "uciname" datatype for cbi validation
Diffstat (limited to 'libs/web/luasrc/cbi')
-rw-r--r--libs/web/luasrc/cbi/datatypes.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua
index 53a34547b..a9aba9549 100644
--- a/libs/web/luasrc/cbi/datatypes.lua
+++ b/libs/web/luasrc/cbi/datatypes.lua
@@ -204,3 +204,7 @@ function device( val, seen )
return false
end
+
+function uciname(val)
+ return (val:match("^[a-zA-Z0-9_]+$") != nil)
+end