summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2010-11-23 00:00:11 +0000
committerSimon McVittie <smcv@debian.org>2010-11-23 00:00:11 +0000
commitd2e3741a6f289bd25b75683990a0548f41661a85 (patch)
treed72f26e01b7bcc34acb12a43556ccd8ac062ab27
parent70bdd57899294fffd30077b7518ba23710c9d55b (diff)
Use local paths for redirection where possible
-rw-r--r--IkiWiki/CGI.pm4
-rw-r--r--IkiWiki/Plugin/comments.pm4
-rw-r--r--IkiWiki/Plugin/editpage.pm10
-rw-r--r--IkiWiki/Plugin/goto.pm2
-rw-r--r--IkiWiki/Plugin/openid.pm2
-rw-r--r--IkiWiki/Plugin/poll.pm4
-rw-r--r--IkiWiki/Plugin/remove.pm2
-rw-r--r--IkiWiki/Plugin/websetup.pm2
8 files changed, 15 insertions, 15 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index f2a32a958..ed6959f89 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -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) {
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index a39dab36c..eefd65741 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -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));
}
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm
index 1a04a72b5..8915211d4 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
@@ -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");
}
}
diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm
index 348a663ef..7f31fa5ca 100644
--- a/IkiWiki/Plugin/goto.pm
+++ b/IkiWiki/Plugin/goto.pm
@@ -64,7 +64,7 @@ sub cgi_goto ($;$) {
)
}
else {
- IkiWiki::redirect($q, urlto($link, undef, 1));
+ IkiWiki::redirect($q, urlto($link, undef));
}
exit;
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index fae9fb77f..3b75c31a2 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -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);
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm
index b333e2cdc..988f4c113 100644
--- a/IkiWiki/Plugin/poll.pm
+++ b/IkiWiki/Plugin/poll.pm
@@ -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;
}
}
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index 1717c8cf3..ab1897663 100644
--- a/IkiWiki/Plugin/remove.pm
+++ b/IkiWiki/Plugin/remove.pm
@@ -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 {
diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm
index 9c032fdc6..ef9a93886 100644
--- a/IkiWiki/Plugin/websetup.pm
+++ b/IkiWiki/Plugin/websetup.pm
@@ -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) {