aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
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") {