diff options
author | Tiago Mello <timello@gmail.com> | 2011-09-20 01:41:31 +0200 |
---|---|---|
committer | Tiago Mello <timello@gmail.com> | 2011-09-20 01:41:31 +0200 |
commit | b3217925e90dcd445d663c5edd4a068ea0714047 (patch) | |
tree | 45b0e6d6ee209407c693de61458c207cb8c475d7 /Bugzilla | |
parent | 4d7f8b007dc0bac0ef2924302dbe2bdc0c049452 (diff) | |
download | bugzilla-b3217925e90dcd445d663c5edd4a068ea0714047.tar.gz bugzilla-b3217925e90dcd445d663c5edd4a068ea0714047.tar.xz |
Bug 686967: Fix incoherent code in Bugzilla::BugUrl::Bugzilla::Local->should_handle()
r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/BugUrl/Bugzilla/Local.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Bugzilla/BugUrl/Bugzilla/Local.pm b/Bugzilla/BugUrl/Bugzilla/Local.pm index 233acbe66..bdfae2835 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 { |