luci-base: validate name in firewall zone selector widget
authorJo-Philipp Wich <jo@mein.io>
Wed, 10 Oct 2018 06:30:13 +0000 (08:30 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 10 Oct 2018 06:30:13 +0000 (08:30 +0200)
When creating a new zone through the firewall zone selector widget,
validate the given name before creating new items.

Depends on commit 0b6ae96f2 ("luci-base: cbi.js: recognize invalid
input in dropdown create field").

Fixes: #2211
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/view/cbi/firewall_zonelist.htm

index 3a108020b6062907cbcaddc2f10ae21ef80e5bde..c5addc0ddb499a690fcda33b5062fc09507d96d2 100644 (file)
@@ -98,7 +98,7 @@
                        <span class="zonebadge">
                                <em><%:create%>:</em>
                                <input type="password" style="display:none" />
-                               <input class="create-item-input" type="text" />
+                               <input class="create-item-input" type="text" data-type="and(uciname,maxlength(11))" data-optional="true" />
                        </span>
                </li>
                <% end %>