summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2022-04-08 12:51:30 +1000
committerJeff Fearn <jfearn@redhat.com>2022-04-08 12:51:30 +1000
commit5049abd550c194662f713d19cf5c9a3a5fce0138 (patch)
tree0d82b28376b9159052cfaf41246b86380b2cecaf
parentXSS fix (diff)
downloadbugzilla-5049abd550c194662f713d19cf5c9a3a5fce0138.tar.gz
bugzilla-5049abd550c194662f713d19cf5c9a3a5fce0138.tar.bz2
bugzilla-5049abd550c194662f713d19cf5c9a3a5fce0138.zip
Bug 2073237 - GitLab pull doesn't support nested projects
uri_encode user suplied components of url. Change-Id: I9742192b6cfb32e352676ca512baa2be9faf5e2a
-rw-r--r--extensions/ExternalBugs/lib/Type/GitLab.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/ExternalBugs/lib/Type/GitLab.pm b/extensions/ExternalBugs/lib/Type/GitLab.pm
index 3736184d9..5dbd28184 100644
--- a/extensions/ExternalBugs/lib/Type/GitLab.pm
+++ b/extensions/ExternalBugs/lib/Type/GitLab.pm
@@ -19,6 +19,7 @@ use JSON;
use URI;
use LWP::UserAgent;
use HTTP::Request;
+use URI::Escape;
use constant TYPE => 'GitLab';
@@ -41,6 +42,9 @@ sub get_data {
my ($group, $project, $number)
= ($ext_bug->ext_bz_bug_id =~ m{^(.*)/(.*)/-/(?:issues|merge_requests)/(.*)});
+ $group = uri_escape_utf8($group);
+ $project = uri_escape_utf8($project);
+ $number = uri_escape_utf8($number);
ThrowUserError("ext_bz_cant_sync_id",
{badvalue => $ext_bug->ext_bz_bug_id, et_type => TYPE})