summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugUrl
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2011-09-20 01:43:40 +0200
committerTiago Mello <timello@gmail.com>2011-09-20 01:43:40 +0200
commit67346e9e26ed523829f1beaed65f07252ea83b61 (patch)
tree163ce38f91b0f2a3f92d45056e6d8c95b31408ea /Bugzilla/BugUrl
parentf6e2d728bc63bc8f92093d5285195abfd7e7d7dd (diff)
downloadbugzilla-67346e9e26ed523829f1beaed65f07252ea83b61.tar.gz
bugzilla-67346e9e26ed523829f1beaed65f07252ea83b61.tar.xz
Bug 686967: Fix incoherent code in Bugzilla::BugUrl::Bugzilla::Local->should_handle()
r/a=LpSolit
Diffstat (limited to 'Bugzilla/BugUrl')
-rw-r--r--Bugzilla/BugUrl/Bugzilla/Local.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/Bugzilla/BugUrl/Bugzilla/Local.pm b/Bugzilla/BugUrl/Bugzilla/Local.pm
index c052d7d3b..9260ba1cb 100644
--- a/Bugzilla/BugUrl/Bugzilla/Local.pm
+++ b/Bugzilla/BugUrl/Bugzilla/Local.pm
@@ -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 {