summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-02-14 15:16:53 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-02-14 15:16:53 +0000
commit63a75c6ea924120273f27a297fae4978ab81d83f (patch)
tree0d9d7975818a5039c37578867c317eaf7649d8d0 /libs/web/luasrc
parentcd4e008cc1536f77d3b879ff9e56b74ce70c828a (diff)
libs/web: implement new phone digit datatype, useful for VoIP related config screens
Diffstat (limited to 'libs/web/luasrc')
-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 71f4a2a56..87019c225 100644
--- a/libs/web/luasrc/cbi/datatypes.lua
+++ b/libs/web/luasrc/cbi/datatypes.lua
@@ -305,3 +305,7 @@ function max(val, max)
return false
end
+
+function ponedigit(val)
+ return (val:match("^[0-9\*#]+$") ~= nil)
+end