luci-base: add a validation for fw4 zone names
authorPaul Donald <[email protected]>
Wed, 3 Dec 2025 15:51:47 +0000 (16:51 +0100)
committerPaul Donald <[email protected]>
Wed, 3 Dec 2025 15:51:47 +0000 (16:51 +0100)
Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/validation.js

index be4ad1c79f46395a0b7dc1dd93ad57d92762f32e..d3208c9b792dbfab9c8c6fb1cd4a539becb1c7f2 100644 (file)
@@ -457,6 +457,10 @@ const ValidatorFactory = baseclass.extend({
                        return this.assert(this.value.match(/^[a-zA-Z0-9_]+$/), _('valid UCI identifier'));
                },
 
+               ucifw4zonename() {
+                       return this.assert(this.value.match(/^[a-zA-Z_][a-zA-Z0-9_]+$/), _('valid fw4 zone name UCI identifier'));
+               },
+
                netdevname() {
                        const v = this.value;