mkanat%bugzilla.org 3b5e8524aa Bug 680131: Replace the MPL 1.1 license by the MPL 2.0 one in all files, and add it to files which miss one
r=kiko r=mkanat r=mrbball a=LpSolit


git-svn-id: svn://10.0.0.236/trunk@263258 18797224-902f-48f8-a5cc-f745e15eee43
2012-01-11 22:48:45 +00:00

43 lines
1.1 KiB
Perl

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package Bugzilla::BugUrl::ReviewBoard;
use strict;
use base qw(Bugzilla::BugUrl);
###############################
#### Methods ####
###############################
sub should_handle {
my ($class, $uri) = @_;
return ($uri->path =~ m|/r/\d+/?$|) ? 1 : 0;
}
sub _check_value {
my $class = shift;
my $uri = $class->SUPER::_check_value(@_);
# Review Board URLs have only one form (the trailing slash is optional):
# http://reviews.reviewboard.org/r/111/
# Make sure there are no query parameters.
$uri->query(undef);
# And remove any # part if there is one.
$uri->fragment(undef);
# make sure the trailing slash is present
if ($uri->path !~ m|/$|) {
$uri->path($uri->path . '/');
}
return $uri;
}
1;