From b073843e25cde03859546a34cea9ab2e7e9a04e3 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 8 Aug 2020 16:30:32 -0700 Subject: [PATCH] Girocco/Util.pm: allow bare '+' in URLs There's no reason not to allow a bare '+' in a repository URL. Go ahead an loosen up the check a bit to allow it. Signed-off-by: Kyle J. McKay --- Girocco/Util.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Girocco/Util.pm b/Girocco/Util.pm index 61834d3..f734e41 100644 --- a/Girocco/Util.pm +++ b/Girocco/Util.pm @@ -216,18 +216,18 @@ sub valid_repo_url { # Currently neither username nor password is allowed in the URL (except for svn) # and IPv6 literal addresses are not accepted either. $Girocco::Config::mirror_svn && - $url =~ /^svn(\+https?)?:\/\/([^\@\/\s]+\@)?[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/os + $url =~ /^svn(\+https?)?:\/\/([^\@\/\s]+\@)?[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/+~-]*)?$/os and return 1; $Girocco::Config::mirror_darcs && - $url =~ /^darcs(?:\+https?)?:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/os + $url =~ /^darcs(?:\+https?)?:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/+~-]*)?$/os and return 1; $Girocco::Config::mirror_bzr && - $url =~ /^bzr:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/os + $url =~ /^bzr:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/+~-]*)?$/os and return 1; $Girocco::Config::mirror_hg && - $url =~ /^hg\+https?:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/os + $url =~ /^hg\+https?:\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/+~-]*)?$/os and return 1; - return $url =~ /^(https?|git):\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; + return $url =~ /^(https?|git):\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/+~-]*)?$/; } sub extract_url_hostname { -- 2.11.4.GIT