Commit a0c3ade6 authored by Mike Frysinger's avatar Mike Frysinger Committed by Gervase Markham

Bug 1229994: MoreBugUrl: Savane: support more sub-urls than just bugs. r=gerv.

parent 35429919
...@@ -19,7 +19,12 @@ use parent qw(Bugzilla::BugUrl); ...@@ -19,7 +19,12 @@ use parent qw(Bugzilla::BugUrl);
sub should_handle { sub should_handle {
my ($class, $uri) = @_; my ($class, $uri) = @_;
return ($uri->as_string =~ m|/bugs/(index\.php)?\?\d+$|) ? 1 : 0; # Savane URLs look like the following (the index.php is optional):
# https://savannah.gnu.org/bugs/index.php?107657
# https://savannah.gnu.org/patch/index.php?107657
# https://savannah.gnu.org/support/index.php?107657
# https://savannah.gnu.org/task/index.php?107657
return ($uri->as_string =~ m|/(bugs\|patch\|support\|task)/(index\.php)?\?\d+$|) ? 1 : 0;
} }
sub _check_value { sub _check_value {
...@@ -27,10 +32,6 @@ sub _check_value { ...@@ -27,10 +32,6 @@ sub _check_value {
my $uri = $class->SUPER::_check_value(@_); my $uri = $class->SUPER::_check_value(@_);
# Savane URLs have only two forms:
# http://gna.org/bugs/index.php?12345
# http://gna.org/bugs/?12345
# And remove any # part if there is one. # And remove any # part if there is one.
$uri->fragment(undef); $uri->fragment(undef);
......
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