From ce785c87022842a53eda6a25088eb4299907f938 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 29 Oct 2009 10:17:30 -0400 Subject: [PATCH] fix url encoding in redir 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 | 3 ++- debian/changelog | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 52cafade0..9277223f0 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -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); } diff --git a/debian/changelog b/debian/changelog index f517111b3..11fdc993f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 26 Oct 2009 11:53:32 -0400