Use local paths for redirection where possible

master
Simon McVittie 2010-11-23 00:00:11 +00:00
parent 70bdd57899
commit d2e3741a6f
8 changed files with 15 additions and 15 deletions

View File

@ -231,11 +231,11 @@ sub cgi_prefs ($$) {
if ($form->submitted eq 'Logout') {
$session->delete();
redirect($q, $config{url});
redirect($q, baseurl(undef));
return;
}
elsif ($form->submitted eq 'Cancel') {
redirect($q, $config{url});
redirect($q, baseurl(undef));
return;
}
elsif ($form->submitted eq 'Save Preferences' && $form->validate) {

View File

@ -386,7 +386,7 @@ sub editcomment ($$) {
if ($form->submitted eq CANCEL) {
# bounce back to the page they wanted to comment on, and exit.
# CANCEL need not be considered in future
IkiWiki::redirect($cgi, urlto($page, undef, 1));
IkiWiki::redirect($cgi, urlto($page, undef));
exit;
}
@ -552,7 +552,7 @@ sub editcomment ($$) {
# Jump to the new comment on the page.
# The trailing question mark tries to avoid broken
# caches and get the most recent version of the page.
IkiWiki::redirect($cgi, urlto($page, undef, 1).
IkiWiki::redirect($cgi, urlto($page, undef).
"?updated#".page_to_id($location));
}

View File

@ -156,13 +156,13 @@ sub cgi_editpage ($$) {
my $previewing=0;
if ($form->submitted eq "Cancel") {
if ($form->field("do") eq "create" && defined $from) {
redirect($q, urlto($from, undef, 1));
redirect($q, urlto($from, undef));
}
elsif ($form->field("do") eq "create") {
redirect($q, $config{url});
redirect($q, baseurl(undef));
}
else {
redirect($q, urlto($page, undef, 1));
redirect($q, urlto($page, undef));
}
exit;
}
@ -262,7 +262,7 @@ sub cgi_editpage ($$) {
@page_locs=$page;
}
else {
redirect($q, urlto($page, undef, 1));
redirect($q, urlto($page, undef));
exit;
}
}
@ -434,7 +434,7 @@ sub cgi_editpage ($$) {
else {
# The trailing question mark tries to avoid broken
# caches and get the most recent version of the page.
redirect($q, urlto($page, undef, 1)."?updated");
redirect($q, urlto($page, undef)."?updated");
}
}

View File

@ -64,7 +64,7 @@ sub cgi_goto ($;$) {
)
}
else {
IkiWiki::redirect($q, urlto($link, undef, 1));
IkiWiki::redirect($q, urlto($link, undef));
}
exit;

View File

@ -175,7 +175,7 @@ sub auth ($$) {
IkiWiki::redirect($q, $setup_url);
}
elsif ($csr->user_cancel) {
IkiWiki::redirect($q, $config{url});
IkiWiki::redirect($q, IkiWiki::baseurl(undef));
}
elsif (my $vident = $csr->verified_identity) {
$session->param(name => $vident->url);

View File

@ -103,7 +103,7 @@ sub sessioncgi ($$) {
my $oldchoice=$session->param($choice_param);
if (defined $oldchoice && $oldchoice eq $choice) {
# Same vote; no-op.
IkiWiki::redirect($cgi, urlto($page, undef, 1));
IkiWiki::redirect($cgi, urlto($page, undef));
exit;
}
@ -153,7 +153,7 @@ sub sessioncgi ($$) {
error($@) if $@;
my $cookie = CGI::Cookie->new(-name=> $session->name, -value=> $session->id);
print $cgi->redirect(-cookie => $cookie,
-url => urlto($page, undef, 1));
-url => urlto($page, undef));
exit;
}
}

View File

@ -240,7 +240,7 @@ sub sessioncgi ($$) {
if (! exists $pagesources{$parent}) {
$parent="index";
}
IkiWiki::redirect($q, urlto($parent, '/', 1));
IkiWiki::redirect($q, urlto($parent, undef));
}
}
else {

View File

@ -344,7 +344,7 @@ sub showform ($$) {
IkiWiki::decode_form_utf8($form);
if ($form->submitted eq "Cancel") {
IkiWiki::redirect($cgi, $config{url});
IkiWiki::redirect($cgi, IkiWiki::baseurl(undef));
return;
}
elsif (($form->submitted eq 'Save Setup' || $form->submitted eq 'Rebuild Wiki') && $form->validate) {