]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/CGI.pm
Allow colons in URLs after the first slash
[git.ikiwiki.info.git] / IkiWiki / CGI.pm
index 4d4464c2872a48c32b331c88cfe4a35c9349a1fc..87cb9c3f3f12c637005cc06ecbbc04b18c5736c5 100644 (file)
@@ -354,9 +354,9 @@ sub cgi_editpage ($$) { #{{{
                });
                $form->tmpl_param("page_preview",
                        htmlize($page, $type,
-                       linkify($page, "",
-                       preprocess($page, $page,
-                       filter($page, $page, $content), 0, 1))));
+                       linkify($page, "/",
+                       preprocess($page, "/",
+                       filter($page, "/", $content), 0, 1))));
                # previewing may have created files on disk
                saveindex();
        }
@@ -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 {