aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-16 01:23:14 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-16 01:23:14 +0000
commit26774c931ce1aa4b91e7129ad602a23b244008b2 (patch)
treea25c3c9e2d954ccad1588ac459143b645fabe0b1 /IkiWiki/CGI.pm
parent39fd60f1abcba33f3d793185cc0e31fb56441215 (diff)
downloadikiwiki-26774c931ce1aa4b91e7129ad602a23b244008b2.tar
ikiwiki-26774c931ce1aa4b91e7129ad602a23b244008b2.tar.gz
* Patch from James Westby to deal with the case where you're editing a
new page, hit cancel, and need to be redirected to somewhere sane.
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index f07a4e5a2..f550b673a 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -439,7 +439,15 @@ sub cgi_editpage ($$) { #{{{
}
if ($form->submitted eq "Cancel") {
- redirect($q, "$config{url}/".htmlpage($page));
+ if ($newfile && defined $from) {
+ redirect($q, "$config{url}/".htmlpage($from));
+ }
+ elsif ($newfile) {
+ redirect($q, $config{url});
+ }
+ else {
+ redirect($q, "$config{url}/".htmlpage($page));
+ }
return;
}
elsif ($form->submitted eq "Preview") {