From: Jo-Philipp Wich Date: Tue, 5 Feb 2013 13:15:48 +0000 (+0000) Subject: libs/web: allow '!' and '.' symbols in phonedigit datatype X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=c6712bdc3c653d694d61bab01628f1621bcb73a3 libs/web: allow '!' and '.' symbols in phonedigit datatype --- diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index e89658dc9..02814a542 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -299,7 +299,7 @@ var cbi_validators = { }, 'phonedigit': function() { - return (this.match(/^[0-9\*#]+$/) != null); + return (this.match(/^[0-9\*#!\.]+$/) != null); } }; diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua index 32530c465..c5f4ec0f0 100644 --- a/libs/web/luasrc/cbi/datatypes.lua +++ b/libs/web/luasrc/cbi/datatypes.lua @@ -341,5 +341,5 @@ function maxlength(val, max) end function phonedigit(val) - return (val:match("^[0-9\*#]+$") ~= nil) + return (val:match("^[0-9\*#!%.]+$") ~= nil) end