]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 686967: Fix incoherent code in Bugzilla::BugUrl::Bugzilla::Local->should_handle()
authorTiago Mello <timello@gmail.com>
Mon, 19 Sep 2011 23:41:31 +0000 (20:41 -0300)
committerTiago Mello <timello@gmail.com>
Mon, 19 Sep 2011 23:41:31 +0000 (20:41 -0300)
r/a=LpSolit

Bugzilla/BugUrl/Bugzilla/Local.pm

index 233acbe6696a7a2c59268a32d382098491cfd81d..bdfae2835a2b55e2e1f867097bbcd5de0e891871 100644 (file)
@@ -95,13 +95,20 @@ sub remove_from_db {
 sub should_handle {
     my ($class, $uri) = @_;
 
-    return $uri->as_string =~ m/^\w+$/ ? 1 : 0;
+    # Check if it is either a bug id number or an alias.
+    return 1 if $uri->as_string =~ m/^\w+$/;
 
+    # Check if it is a local Bugzilla uri and call
+    # Bugzilla::BugUrl::Bugzilla to check if it's a valid Bugzilla
+    # see also url.
     my $canonical_local = URI->new($class->local_uri)->canonical;
+    if ($canonical_local->authority eq $uri->canonical->authority
+        and $canonical_local->path eq $uri->canonical->path)
+    {
+        return $class->SUPER::should_handle($uri);
+    }
 
-    # Treating the domain case-insensitively and ignoring http(s)://
-    return ($canonical_local->authority eq $uri->canonical->authority
-            and $canonical_local->path eq $uri->canonical->path) ? 1 : 0;
+    return 0;
 }
 
 sub _check_value {