summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Quantum.pm23
-rwxr-xr-xscripts/rewrite2mojo.pl19
2 files changed, 13 insertions, 29 deletions
diff --git a/Bugzilla/Quantum.pm b/Bugzilla/Quantum.pm
index 7d679e3c3..0c1356dd8 100644
--- a/Bugzilla/Quantum.pm
+++ b/Bugzilla/Quantum.pm
@@ -84,29 +84,6 @@ sub startup {
},
);
- my $urlbase = Bugzilla->localconfig->{urlbase};
- $r->get(
- '/quicksearch.html' => sub {
- my $c = shift;
- $c->res->code(301);
- $c->redirect_to( $urlbase . 'page.cgi?id=quicksearch.html' );
- }
- );
- $r->get(
- '/bugwritinghelp.html' => sub {
- my $c = shift;
- $c->res->code(301);
- $c->redirect_to( $urlbase . 'page.cgi?id=bug-writing.html', 301 );
- }
- );
- $r->get(
- '/<bug_id:num>' => sub {
- my $c = shift;
- $c->res->code(301);
- my $bug_id = $c->param('bug_id');
- $c - redirect_to( $urlbase . "show_bug.cgi?id=$bug_id" );
- }
- );
}
1;
diff --git a/scripts/rewrite2mojo.pl b/scripts/rewrite2mojo.pl
index 42188d739..66fc0d832 100755
--- a/scripts/rewrite2mojo.pl
+++ b/scripts/rewrite2mojo.pl
@@ -17,22 +17,29 @@ while (<>) {
my ($regex, $target, $flags) = @args;
$flags //= '';
next if $flags =~ /E=HTTP/;
+ next if $target eq '-';
+ next if $target =~ /BzAPI/;
+ next if $target =~ /rest\.cgi/;
my $action = 'rewrite_query';
if ($flags =~ /R/) {
$action = 'redirect';
}
- say qq{# from line $. of $ARGV};
say "if (my \@match = \$path =~ m{$regex}s) {";
say " $action(\$c, q{$target}, \@match);";
say " return;" if $flags =~ /L/;
say "}";
}
elsif (lc($cmd) eq "\LRedirect") {
- say qq{# from line $. of $ARGV};
- say "if (my \@match = \$path =~ m{$regex}s) {";
- say " $action(\$c, q{$target}, \@match);";
- say " return;" if $flags =~ /L/;
- say "}";
+ my ($type, $path, $url) = @args;
+ if ($type eq 'permanent') {
+ say "if (\$path =~ m{^\Q$path\E}s) {";
+ say " redirect(\$c, q{$url});";
+ say " return;";
+ say "}";
+ }
+ else {
+ warn "I don't understand Redirect $type\n";
+ }
}
}