luci-base: firewall.js: remove further zone network/name fallback logic
authorJo-Philipp Wich <jo@mein.io>
Sun, 24 May 2020 15:32:14 +0000 (17:32 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 24 May 2020 15:33:53 +0000 (17:33 +0200)
Fixes: #4093
Fixes: 4052436d8 ("luci-base: firewall.js: don't treat zone name as network fallback")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f6f4005d0baf70f04752747822cda9f1248c47ca)

modules/luci-base/htdocs/luci-static/resources/firewall.js

index f7b731e6fcafc60c8302ec9edd481a8298594f5e..b1c7de435887ec99493c0d95b99b7754909c142a 100644 (file)
@@ -140,7 +140,7 @@ Firewall = L.Class.extend({
                        var sections = uci.sections('firewall', 'zone');
 
                        for (var i = 0; i < sections.length; i++)
-                               if (L.toArray(sections[i].network || sections[i].name).indexOf(network) != -1)
+                               if (L.toArray(sections[i].network).indexOf(network) != -1)
                                        return new Zone(sections[i]['.name']);
 
                        return null;
@@ -202,9 +202,6 @@ Firewall = L.Class.extend({
                                if (sections[i].name != oldName)
                                        continue;
 
-                               if (L.toArray(sections[i].network).length == 0)
-                                       uci.set('firewall', sections[i]['.name'], 'network', oldName);
-
                                uci.set('firewall', sections[i]['.name'], 'name', newName);
                                found = true;
                        }