summaryrefslogtreecommitdiffstats
path: root/extensions/MoreBugUrl/lib
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 /extensions/MoreBugUrl/lib
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 'extensions/MoreBugUrl/lib')
-rw-r--r--extensions/MoreBugUrl/lib/GetSatisfaction.pm2
-rw-r--r--extensions/MoreBugUrl/lib/PHP.pm4
-rw-r--r--extensions/MoreBugUrl/lib/RT.pm2
3 files changed, 4 insertions, 4 deletions
diff --git a/extensions/MoreBugUrl/lib/GetSatisfaction.pm b/extensions/MoreBugUrl/lib/GetSatisfaction.pm
index 4c077b1a6..75d5ece39 100644
--- a/extensions/MoreBugUrl/lib/GetSatisfaction.pm
+++ b/extensions/MoreBugUrl/lib/GetSatisfaction.pm
@@ -20,7 +20,7 @@ sub should_handle {
# GetSatisfaction URLs only have one form:
# http(s)://getsatisfaction.com/PROJECT_NAME/topics/TOPIC_NAME
- return ($uri->authority =~ /^getsatisfaction.com$/i
+ return (lc($uri->authority) eq 'getsatisfaction.com'
and $uri->path =~ m|^/[^/]+/topics/[^/]+$|) ? 1 : 0;
}
diff --git a/extensions/MoreBugUrl/lib/PHP.pm b/extensions/MoreBugUrl/lib/PHP.pm
index 1521cae1a..ea090e865 100644
--- a/extensions/MoreBugUrl/lib/PHP.pm
+++ b/extensions/MoreBugUrl/lib/PHP.pm
@@ -20,8 +20,8 @@ sub should_handle {
# PHP Bug URLs have only one form:
# https://bugs.php.net/bug.php?id=1234
- return ($uri->authority =~ /^bugs.php.net$/i
- and $uri->path =~ m|/bug.php$|
+ return (lc($uri->authority) eq 'bugs.php.net'
+ and $uri->path =~ m|/bug\.php$|
and $uri->query_param('id') =~ /^\d+$/) ? 1 : 0;
}
diff --git a/extensions/MoreBugUrl/lib/RT.pm b/extensions/MoreBugUrl/lib/RT.pm
index 724456828..a1ca6fd88 100644
--- a/extensions/MoreBugUrl/lib/RT.pm
+++ b/extensions/MoreBugUrl/lib/RT.pm
@@ -21,7 +21,7 @@ sub should_handle {
# RT URLs can look like various things:
# http://example.com/rt/Ticket/Display.html?id=1234
# https://example.com/Public/Bug/Display.html?id=1234
- return ($uri->path =~ m|/Display.html$|
+ return ($uri->path =~ m|/Display\.html$|
and $uri->query_param('id') =~ /^\d+$/) ? 1 : 0;
}