drop redir loop detection code

it won't work for incremental builds

for now, relying on browsers to notice loops
master
Joey Hess 2007-12-08 15:05:41 -05:00
parent 2c78477387
commit ccf99970a7
1 changed files with 0 additions and 7 deletions

View File

@ -13,7 +13,6 @@ my %author;
my %authorurl; my %authorurl;
my %license; my %license;
my %copyright; my %copyright;
my %redirected;
sub import { #{{{ sub import { #{{{
hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@ -71,18 +70,12 @@ sub preprocess (@) { #{{{
} }
} }
elsif ($key eq 'redir') { elsif ($key eq 'redir') {
$redirected{$page}=1;
my $safe=0; my $safe=0;
if ($value =~ /^$config{wiki_link_regexp}$/) { if ($value =~ /^$config{wiki_link_regexp}$/) {
my $link=bestlink($page, $value); my $link=bestlink($page, $value);
if (! length $link) { if (! length $link) {
return "[[meta ".gettext("redir page not found")."]]"; return "[[meta ".gettext("redir page not found")."]]";
} }
if ($redirected{$link}) {
# TODO this is a cheap way of avoiding
# redir cycles, but it is really too strict.
return "[[meta ".gettext("redir to page that itself redirs is not allowed")."]]";
}
$value=urlto($link, $destpage); $value=urlto($link, $destpage);
$safe=1; $safe=1;
} }