summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugUrl
diff options
context:
space:
mode:
authorHugo Seabrook <hugo.seabrook@gmail.com>2013-02-16 23:21:49 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2013-02-16 23:21:49 +0100
commit91a5a96b0b9890808fe888b60ba552cb49d874a8 (patch)
treebd33b67b550f6113920ad7a338bb00dd4cf9929d /Bugzilla/BugUrl
parentf45ef9337770947f5bb36829c0427e14775ffe54 (diff)
downloadbugzilla-91a5a96b0b9890808fe888b60ba552cb49d874a8.tar.gz
bugzilla-91a5a96b0b9890808fe888b60ba552cb49d874a8.tar.xz
Bug 825758: Most Bugzilla::BugUrl::* modules incorrectly validate the domain name
r/a=LpSolit
Diffstat (limited to 'Bugzilla/BugUrl')
-rw-r--r--Bugzilla/BugUrl/Debian.pm2
-rw-r--r--Bugzilla/BugUrl/GitHub.pm2
-rw-r--r--Bugzilla/BugUrl/Google.pm2
-rw-r--r--Bugzilla/BugUrl/Launchpad.pm2
-rw-r--r--Bugzilla/BugUrl/SourceForge.pm2
5 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/BugUrl/Debian.pm b/Bugzilla/BugUrl/Debian.pm
index 7ab8bf173..97ad4b545 100644
--- a/Bugzilla/BugUrl/Debian.pm
+++ b/Bugzilla/BugUrl/Debian.pm
@@ -22,7 +22,7 @@ sub should_handle {
# Debian BTS URLs can look like various things:
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1234
# http://bugs.debian.org/1234
- return ($uri->authority =~ /^bugs.debian.org$/i
+ return (lc($uri->authority) eq 'bugs.debian.org'
and (($uri->path =~ /bugreport\.cgi$/
and $uri->query_param('bug') =~ m|^\d+$|)
or $uri->path =~ m|^/\d+$|)) ? 1 : 0;
diff --git a/Bugzilla/BugUrl/GitHub.pm b/Bugzilla/BugUrl/GitHub.pm
index dbcaf655f..2c35bfb08 100644
--- a/Bugzilla/BugUrl/GitHub.pm
+++ b/Bugzilla/BugUrl/GitHub.pm
@@ -21,7 +21,7 @@ sub should_handle {
# GitHub issue URLs have only one form:
# https://github.com/USER_OR_TEAM_OR_ORGANIZATION_NAME/REPOSITORY_NAME/issues/111
- return ($uri->authority =~ /^github.com$/i
+ return (lc($uri->authority) eq 'github.com'
and $uri->path =~ m|^/[^/]+/[^/]+/issues/\d+$|) ? 1 : 0;
}
diff --git a/Bugzilla/BugUrl/Google.pm b/Bugzilla/BugUrl/Google.pm
index eb9aa88f2..dd9ab7ff4 100644
--- a/Bugzilla/BugUrl/Google.pm
+++ b/Bugzilla/BugUrl/Google.pm
@@ -21,7 +21,7 @@ sub should_handle {
# Google Code URLs only have one form:
# http(s)://code.google.com/p/PROJECT_NAME/issues/detail?id=1234
- return ($uri->authority =~ /^code.google.com$/i
+ return (lc($uri->authority) eq 'code.google.com'
and $uri->path =~ m|^/p/[^/]+/issues/detail$|
and $uri->query_param('id') =~ /^\d+$/) ? 1 : 0;
}
diff --git a/Bugzilla/BugUrl/Launchpad.pm b/Bugzilla/BugUrl/Launchpad.pm
index 43c5c57d9..3409cbe19 100644
--- a/Bugzilla/BugUrl/Launchpad.pm
+++ b/Bugzilla/BugUrl/Launchpad.pm
@@ -23,7 +23,7 @@ sub should_handle {
# https://bugs.launchpad.net/ubuntu/+bug/1234
# https://launchpad.net/bugs/1234
# All variations end with either "/bugs/1234" or "/+bug/1234"
- return ($uri->authority =~ /launchpad.net$/
+ return ($uri->authority =~ /launchpad\.net$/
and $uri->path =~ m|bugs?/\d+$|) ? 1 : 0;
}
diff --git a/Bugzilla/BugUrl/SourceForge.pm b/Bugzilla/BugUrl/SourceForge.pm
index 90a7ca6a5..630b97d7a 100644
--- a/Bugzilla/BugUrl/SourceForge.pm
+++ b/Bugzilla/BugUrl/SourceForge.pm
@@ -21,7 +21,7 @@ sub should_handle {
# SourceForge tracker URLs have only one form:
# http://sourceforge.net/tracker/?func=detail&aid=111&group_id=111&atid=111
- return ($uri->authority =~ /^sourceforge.net$/i
+ return (lc($uri->authority) eq 'sourceforge.net'
and $uri->path =~ m|/tracker/|
and $uri->query_param('func') eq 'detail'
and $uri->query_param('aid')