Commit 67346e9e authored by Tiago Mello's avatar Tiago Mello

Bug 686967: Fix incoherent code in Bugzilla::BugUrl::Bugzilla::Local->should_handle()

r/a=LpSolit
parent f6e2d728
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment