From aa08527dc9c4bc1bb15c366edcdc289ca0fd4443 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Wed, 10 Jul 2019 13:26:06 -0400 Subject: [PATCH] Fixed #9586 by detecting if option list includes /0 or not (cherry picked from commit 7ec80e763f7e8357a4e5b0d2d57546cfd5d0f0f0) --- src/usr/local/www/js/pfSenseHelpers.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js index 33976b8581..3eb4ee21d9 100644 --- a/src/usr/local/www/js/pfSenseHelpers.js +++ b/src/usr/local/www/js/pfSenseHelpers.js @@ -184,7 +184,14 @@ function setMasks() { if (input.val() == "") return; - while (select.options.length > max) + // Sometimes the mask includes '0' (e.g. for VPNs), sometimes it does not + if (select.options[select.options.length - 1].value == 0) { + var mm = max + 1; + } else { + var mm = max; + } + + while (select.options.length > mm) select.remove(0); if (select.options.length < max) {