luci-proto-wireguard: explicitely escape slashes in regex literals
authorJo-Philipp Wich <jo@mein.io>
Tue, 21 Jan 2020 17:38:04 +0000 (18:38 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 22 Jan 2020 21:02:24 +0000 (22:02 +0100)
The unespaced slashes confuse xgettext and likely other source
scanners as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index ab76326eee428c972d82b6662a9b29fcb0f4d133..c9b00abdece4334a379d19dd7d9181b5b2212fab 100644 (file)
@@ -6,7 +6,7 @@ function validateBase64(section_id, value) {
        if (value.length == 0)
                return true;
 
-       if (value.length != 44 || !value.match(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))
+       if (value.length != 44 || !value.match(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/))
                return _('Invalid Base64 key string');
 
        return true;