]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 825758: Most Bugzilla::BugUrl::* modules incorrectly validate the domain name
authorHugo Seabrook <hugo.seabrook@gmail.com>
Sat, 16 Feb 2013 22:21:49 +0000 (23:21 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 16 Feb 2013 22:21:49 +0000 (23:21 +0100)
r/a=LpSolit

Bugzilla/BugUrl/Debian.pm
Bugzilla/BugUrl/GitHub.pm
Bugzilla/BugUrl/Google.pm
Bugzilla/BugUrl/Launchpad.pm
Bugzilla/BugUrl/SourceForge.pm
extensions/MoreBugUrl/lib/GetSatisfaction.pm
extensions/MoreBugUrl/lib/PHP.pm
extensions/MoreBugUrl/lib/RT.pm

index 7ab8bf17365e09486bb6ae9d99feec12dcc63ecb..97ad4b5456d35dcc6823ab96dcf4fc074aa0861a 100644 (file)
@@ -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;
index dbcaf655f3ae6bf255343dd0c8f9a08ccf8630b1..2c35bfb0827ee8a0b258f750ad7b7f07d86515b8 100644 (file)
@@ -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;
 }
 
index eb9aa88f285eddb06cb56ae5704f073a791fd3d7..dd9ab7ff4b0a887ef4b089a80b6ac5afb2a55c37 100644 (file)
@@ -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;
 }
index 43c5c57d95a475c0c9e74b33a4c0c311a5ecd6f5..3409cbe19fbacaf35517026e0eee2980cab5ec9d 100644 (file)
@@ -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;
 }
 
index 90a7ca6a5815277b79e8c57d26423c19362dbb4d..630b97d7a7dcb5e0f2c6bd773bdc6b8af3ba1f6e 100644 (file)
@@ -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')
index 4c077b1a6114059bb2662ded3ef89ba2210e3ad1..75d5ece3975930bbb2f86e93de904bf8110b9375 100644 (file)
@@ -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;
 }
 
index 1521cae1a04f18f77a953cd806c0b34e4c8e0380..ea090e8652b7f1c3e79c40f3953f8fae396fff86 100644 (file)
@@ -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;
 }
 
index 7244568280afc4422653719529c727db40567757..a1ca6fd8856ea7d10fb51a68b25550e4c30c9a2e 100644 (file)
@@ -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;
 }