From a3d588cca2a045a3c2b07c6e98825a3bce0367e2 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 12 Feb 2025 14:48:05 +0100 Subject: [PATCH] Services: Captive Portal: Vouchers - urlencode() selector items in vouchergrouplist, closes https://github.com/opnsense/core/issues/8319 Although this isn't the prettiest option in the world, it does solve the issue. It would have been better if we had "keyed" the items in some way so input is less sensitive for issues like these --- src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt b/src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt index 17a097b40..287ac94b4 100644 --- a/src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt +++ b/src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt @@ -63,7 +63,7 @@ if (status == "success") { $('#voucher-groups').html(""); $.each(data, function(key, value) { - $('#voucher-groups').append($("").attr("value", value).text(value)); + $('#voucher-groups').append($("").attr("value", encodeURIComponent(value)).text(value)); }); $('.selectpicker').selectpicker('refresh'); // link on change event