luci-app-banip: fix URL regex in custom feed editor
authorDirk Brenken <dev@brenken.org>
Mon, 17 Jul 2023 14:09:45 +0000 (16:09 +0200)
committerDirk Brenken <dev@brenken.org>
Mon, 17 Jul 2023 14:11:16 +0000 (16:11 +0200)
- accept special chars for BASIC AUTH in URL

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

applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js

index 267ca410f7a56ccea4f4da8c019a6c10ac0d83b5..0e4e682986fc7f84950f6ea4db31502cd2905490 100644 (file)
@@ -205,7 +205,7 @@ return view.extend({
                                if (!value) {
                                        return true;
                                }
-                               if (!value.match(/^(http:\/\/|https:\/\/)[A-Za-z0-9\/\.\-_\?\&\+=~#]+$/)) {
+                               if (!value.match(/^(http:\/\/|https:\/\/)[A-Za-z0-9\/\.\-\?\&\+_@%=:~#]+$/)) {
                                        return _('Protocol/URL format not supported');
                                }
                                return true;
@@ -218,7 +218,7 @@ return view.extend({
                                if (!value) {
                                        return true;
                                }
-                               if (!value.match(/^(http:\/\/|https:\/\/)[A-Za-z0-9\/\.\-_\?\&\+=:~#]+$/)) {
+                               if (!value.match(/^(http:\/\/|https:\/\/)[A-Za-z0-9\/\.\-\?\&\+_@%=:~#]+$/)) {
                                        return _('Protocol/URL format not supported');
                                }
                                return true;