]> 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:23:14 +0000 (23:23 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 16 Feb 2013 22:23:14 +0000 (23:23 +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 78397bdd947ee61ee20ec2e0ac33eae1f07ad6af..cce4c25fda06bebf6a6d10cd3be6518ca952d338 100644 (file)
@@ -19,7 +19,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 63be65bed8a042458833ebebb3edfe05cffed4d5..eeffa2ed6d8410f3f876a0e87e952049157c98ba 100644 (file)
@@ -18,7 +18,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 8b8638c7a0a5a5df634750265716cad3b91604fc..9c49f0dcccfa4a0245ab5160948590bfcf2f9a49 100644 (file)
@@ -18,7 +18,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 87fb71a5dc8f5d28415bcae1687a830ad8f3e58b..2ae2c383d75cc30236ea9bd28564201f09475fe6 100644 (file)
@@ -20,7 +20,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 11cdd0ff186759596bc23a00668fddfaa7e99bab..fcc720049907fc2ed4873e361bdacefb085d9220 100644 (file)
@@ -18,7 +18,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 ff63b10e1a2c567299e400fe7ba032a2e7e0bc4e..e4548563f2338721e97ee513ecdacb4399422eef 100644 (file)
@@ -18,7 +18,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 c8d4e1689e41a1dce55144e82b4df947fcc5d1f5..c17a49998df01444351e679b85831ff25a6748bd 100644 (file)
@@ -18,8 +18,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 0d5faa2a88ab44757945c1dba2b03b7d63b4bd68..724c773a2e75fd1bc0309f76fa9580c6da2126a3 100644 (file)
@@ -19,7 +19,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;
 }