Put in a quick fix for a bug involving page preview while creating a page
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 28 Mar 2006 22:56:56 +0000 (22:56 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 28 Mar 2006 22:56:56 +0000 (22:56 +0000)
that caused the page location to be changed to a subdir. This is not a very
good fix.

IkiWiki/CGI.pm

index f472413b80765be538d293b82ec77297f5a45102..89047a9525f43957e2c7ab08425cefcc7979ea1a 100644 (file)
@@ -355,7 +355,9 @@ sub cgi_editpage ($$) { #{{{
                        my ($from)=$form->param('from')=~/$config{wiki_file_regexp}/;
                        if (! defined $from || ! length $from ||
                            $from ne $form->param('from') ||
-                           $from=~/$config{wiki_file_prune_regexp}/ || $from=~/^\//) {
+                           $from=~/$config{wiki_file_prune_regexp}/ ||
+                           $from=~/^\// ||
+                           $form->submitted eq "Preview") {
                                @page_locs=$best_loc=$page;
                        }
                        else {