luci-app-firewall: tools.firewall: properly handle protocol 0
authorJo-Philipp Wich <jo@mein.io>
Wed, 4 Mar 2020 19:21:23 +0000 (20:21 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 4 Mar 2020 19:22:38 +0000 (20:22 +0100)
The existing code failed to anticipate that '' == 0 in JS.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js

index cfa6c836510e3df7762efa1ebe549854ad6c060e..640b28cf7421daffa62667a6dfc9088739c355d3 100644 (file)
@@ -69,7 +69,7 @@ var protocols = [
 ];
 
 function lookupProto(x) {
-       if (x == null || x == '')
+       if (x == null || x === '')
                return null;
 
        var s = String(x).toLowerCase();