diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-06-14 20:32:43 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-06-28 22:41:58 +0200 |
commit | b3a6e0da65144921a99a369398dd390f5c65bef3 (patch) | |
tree | 599fe3abc1c6837fbdd55272968bee1a29363020 | |
parent | 258d3e1c7d5d99ab202ffe5ce777c435fc34d44a (diff) | |
download | bugzilla-b3a6e0da65144921a99a369398dd390f5c65bef3.tar.gz bugzilla-b3a6e0da65144921a99a369398dd390f5c65bef3.tar.xz |
work in progress
-rw-r--r-- | Bugzilla/Quantum.pm | 23 | ||||
-rwxr-xr-x | scripts/rewrite2mojo.pl | 19 |
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"; + } } } |