]> sipb.mit.edu Git - ikiwiki.git/commitdiff
fix url encoding in redir
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 29 Oct 2009 14:17:30 +0000 (10:17 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 29 Oct 2009 14:17:30 +0000 (10:17 -0400)
When redirecting to a page, ie, after editing, ensure that the url is
uri-encoded. Most browsers other than MSIE don't care, but it's the right
thing to do.

The known failure case involved editing a page that had utf-8 in the name
using MSIE.

IkiWiki/CGI.pm
debian/changelog

index 52cafade0f9f7f7ae155402464283e22c991a67d..9277223f00e8e8d0f30071e7b47462db54cd5e55 100644 (file)
@@ -40,7 +40,8 @@ sub showform ($$$$;@) {
 
 sub redirect ($$) {
        my $q=shift;
-       my $url=shift;
+       eval q{use URI};
+       my $url=URI->new(shift);
        if (! $config{w3mmode}) {
                print $q->redirect($url);
        }
index f517111b3d00d3246f5ce87c925c23fdfbeb7763..11fdc993f0bf7c53a3437af9859506b0d8d31ac4 100644 (file)
@@ -4,6 +4,9 @@ ikiwiki (3.20091024) UNRELEASED; urgency=low
   * mdwn: Avoid trying to use multimarkdown if it is not installed. 
   * moderatedcomments: New plugin to allow comment moderation w/o relying
     on blogspam.net.
+  * When redirecting to a page, ie, after editing, ensure that the
+    url is uri-encoded. Most browsers other than MSIE don't care, but it's
+    the right thing to do.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 26 Oct 2009 11:53:32 -0400