]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Patch from James Westby to deal with the case where you're editing a
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 16 Sep 2006 01:23:14 +0000 (01:23 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 16 Sep 2006 01:23:14 +0000 (01:23 +0000)
    new page, hit cancel, and need to be redirected to somewhere sane.

IkiWiki/CGI.pm
debian/changelog
doc/bugs/404_when_cancel_create_page.mdwn

index f07a4e5a2c7941561d3d1416b13de3cf47d30feb..f550b673a7acceaee1f35195565487b6857cab81 100644 (file)
@@ -439,7 +439,15 @@ sub cgi_editpage ($$) { #{{{
        }
        
        if ($form->submitted eq "Cancel") {
        }
        
        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") {
                return;
        }
        elsif ($form->submitted eq "Preview") {
index ee6fb6a85fdb59fe207c67ee61a603186874e4a3..72c33e90367f18cd32f46216121e10547cd9d0ca 100644 (file)
@@ -36,10 +36,12 @@ ikiwiki (1.27) UNRELEASED; urgency=low
   * pagetemplate hooks are now also called when generating cgi pages.
   * Add a favicon plugin, which simply adds a link tag for an icon to each
     page (and cgis).
   * pagetemplate hooks are now also called when generating cgi pages.
   * Add a favicon plugin, which simply adds a link tag for an icon to each
     page (and cgis).
-  * Deal with CPAN installing Markdown as Text::Markdown, while it's 
+  * Deal with CPAN installing Markdown as Text::Markdown, while it's
     installed as just Markdown by apt.
     installed as just Markdown by apt.
+  * 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.
 
 
- -- Joey Hess <joeyh@debian.org>  Fri, 15 Sep 2006 21:13:35 -0400
+ -- Joey Hess <joeyh@debian.org>  Fri, 15 Sep 2006 21:20:31 -0400
 
 ikiwiki (1.26) unstable; urgency=low
 
 
 ikiwiki (1.26) unstable; urgency=low
 
index b802de787437e0555f93acea5edad20c4d5cebb1..091254cb5f731dca3e64729bcfa8d212d6ee457b 100644 (file)
@@ -25,7 +25,9 @@ if it is known.
                 }
                 elsif ($form->submitted eq "Preview") {
 
                 }
                 elsif ($form->submitted eq "Preview") {
 
-
+> I think you mean to use `$newfile`? I've applied a modieid version
+> that also deal with creating a new page with no defined $from location.
+> [[bugs/done]] --[[Joey]] 
 
 [P.S. just above that is 
 
 
 [P.S. just above that is 
 
@@ -43,4 +45,9 @@ is there aren't going to be many possible extensions. Something like `/(.\w+)+/`
 (groups of dot separated alpha-num chars if my perl-foo isn't failing me). You could
 at least exclude `/` and `..`. I'm happy to turn this in to a patch if you agree.]
 
 (groups of dot separated alpha-num chars if my perl-foo isn't failing me). You could
 at least exclude `/` and `..`. I'm happy to turn this in to a patch if you agree.]
 
-
+> The reason it's safe to use possibly_foolish_untaint here is because
+> of the check for $hooks{htmlize}{$type}. This limits it to types
+> that have a registered htmlize hook (mdwn, etc), and not whatever random
+> garbage an attacker might try to put in. If it wasn't for that check,
+> using possibly_foolish_untaint there would be _very_ foolish indeed.. 
+> --[[Joey]]