luci-app-openvpn: fix upload input validator
authorDirk Brenken <dev@brenken.org>
Wed, 25 Mar 2020 07:38:07 +0000 (08:38 +0100)
committerDirk Brenken <dev@brenken.org>
Fri, 27 Mar 2020 15:49:19 +0000 (16:49 +0100)
* accept/replace common '.' seperator in instance names as well,
  see comment in #2235

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 51579cd49e67890a427bb56a76dc49719d39a9f6)

applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm

index 3e83df20a264edc875e182a5e62c6b4f851af3cb..9ca1e87fa4e9065f1a5fe1a2a7eb4455a6fa6925 100644 (file)
@@ -3,7 +3,7 @@
 //<![CDATA[
        function vpn_add()
        {
-               var vpn_name     = div_add.querySelector("#instance_name1").value.replace(/[^\x00-\x7F]|[\s!@#$%^&*()\-+=\[\]{};':"\\|,<>\/?]/g,'');
+               var vpn_name     = div_add.querySelector("#instance_name1").value.replace(/[^\x00-\x7F]|[\s\.!@#$%^&*()\-+=\[\]{};':"\\|,<>\/?]/g,'');
                var vpn_template = div_add.querySelector("#instance_template").value;
                var form         = document.getElementsByName('cbi')[0];
 
@@ -31,7 +31,7 @@
 
        function vpn_upload()
        {
-               var vpn_name = div_upload.querySelector("#instance_name2").value.replace(/[^\x00-\x7F]|[\s!@#$%^&*()\-+=\[\]{};':"\\|,<>\/?]/g,'');
+               var vpn_name = div_upload.querySelector("#instance_name2").value.replace(/[^\x00-\x7F]|[\s\.!@#$%^&*()\-+=\[\]{};':"\\|,<>\/?]/g,'');
                var vpn_file = document.getElementById("ovpn_file").value;
                var form     = document.getElementsByName('cbi')[0];