summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js')
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js
index c9f3e1131a..40d47cb2e4 100644
--- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/ipsets.js
@@ -41,6 +41,12 @@ return view.extend({
o = s.option(form.Value, 'name', _('Name'));
o.optional = false;
o.rmempty = false;
+ o.validate = function (section_id, value) {
+ if (!/^[a-zA-Z_.][a-zA-Z0-9\/_.-]*$/.test(value))
+ return _('Invalid set name');
+
+ return true;
+ };
} else {
o = s.option(form.Value, 'name', _('Name'));
o.depends({ external: '' });