summaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 4d4464c28..cfb2c0b1d 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -394,9 +394,10 @@ sub cgi_editpage ($$) { #{{{
$dir=~s![^/]+/+$!!;
push @page_locs, $dir.$page;
}
+
+ push @page_locs, "$config{userdir}/$page"
+ if length $config{userdir};
}
- push @page_locs, "$config{userdir}/$page"
- if length $config{userdir};
@page_locs = grep {
! exists $pagecase{lc $_}
@@ -404,8 +405,16 @@ sub cgi_editpage ($$) { #{{{
if (! @page_locs) {
# hmm, someone else made the page in the
# meantime?
- redirect($q, "$config{url}/".htmlpage($page));
- return;
+ if ($form->submitted eq "Preview") {
+ # let them go ahead with the edit
+ # and resolve the conflict at save
+ # time
+ @page_locs=$page;
+ }
+ else {
+ redirect($q, "$config{url}/".htmlpage($page));
+ return;
+ }
}
my @editable_locs = grep {