]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Fix issue with utf-8 in wikiname breaking session cookies, by entity-encoding the...
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 20 Oct 2008 01:07:12 +0000 (21:07 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 20 Oct 2008 01:07:12 +0000 (21:07 -0400)
IkiWiki/CGI.pm
debian/changelog
doc/bugs/unicode_chars_in_wikiname_break_auth.mdwn

index dac522eea470a544248c9c77406009b27d4d9997..4399d0dcbba5a8726f57a76d8e36ac3e42107341 100644 (file)
@@ -278,9 +278,9 @@ sub check_banned ($$) { #{{{
 sub cgi_getsession ($) { #{{{
        my $q=shift;
 
-       eval q{use CGI::Session};
+       eval q{use CGI::Session; use HTML::Entities};
        error($@) if $@;
-       CGI::Session->name("ikiwiki_session_".encode_utf8($config{wikiname}));
+       CGI::Session->name("ikiwiki_session_".encode_entities($config{wikiname}));
        
        my $oldmask=umask(077);
        my $session = eval {
index 1f47f614eb017adbdfb9cc84e132195efbc5b3d2..352329f94b8d7110410d8a580e88676190e89a8e 100644 (file)
@@ -12,6 +12,8 @@ ikiwiki (2.68) UNRELEASED; urgency=low
   * Plugins that used to override displaytime should instead override
     formattime. displaytime will call that, and may wrap markup around the
     formatted time.
+  * Fix issue with utf-8 in wikiname breaking session cookies, by
+    entity-encoding the wikiname in the session cookie.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 17 Oct 2008 20:11:02 -0400
 
index c272d4b4f63eaee6d94641ab3253efff1ffb7bc0..7c71ff0ff2b985f35b2caaaba14f42d7fb7a6819 100644 (file)
@@ -5,4 +5,10 @@ Inspecting the cookie information (thanks to Iceweasel's webdeveloper add-on), I
 
 Replacing "ยท" with "-" in `wikiname` fixed this login issue.
 
+> Hmm, Recai sent me a patch a long time ago to handle utf-8 here by encoding
+> the wikiname. But it doesn't seem to work, somehow the encoded utf-8
+> value still doesn't make it through. (CGI::Session seems to have underermined utf-8
+> issues too.) Seems like I will have to possibly break some sessions and
+> entity-encode the wikiname in the cookie.. done. --[[Joey]]
+
 (BTW, such a char was replaced by -I don't remember what encoding thingie- in my setup file, when running `ikiwiki-transition setupformat`.)