]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
HTML-encode meta title, description, guid on output, but not in the pagestate
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index 8f8472f075f20c69e57578b75041c4ce145224f1..0aa043215b35a5ab32b2219dfc5410ac64c507cc 100644 (file)
@@ -221,7 +221,9 @@ sub preprocess {
        }
 
        if (defined $params{subject}) {
-               $pagestate{$page}{meta}{title} = $params{subject};
+               # decode title the same way meta does
+               eval q{use HTML::Entities};
+               $pagestate{$page}{meta}{title} = decode_entities($params{subject});
        }
 
        if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
@@ -839,7 +841,7 @@ sub unique_comment_location ($$$) {
 
        eval q{use Digest::MD5 'md5_hex'};
        error($@) if $@;
-       my $content_md5=md5_hex(shift);
+       my $content_md5=md5_hex(Encode::encode_utf8(shift));
 
        my $dir=shift;
 
@@ -855,14 +857,14 @@ sub unique_comment_location ($$$) {
 
 sub page_to_id ($) {
        # Converts a comment page name into a unique, legal html id
-       # addtibute value, that can be used as an anchor to link to the
+       # attribute value, that can be used as an anchor to link to the
        # comment.
        my $page=shift;
 
        eval q{use Digest::MD5 'md5_hex'};
        error($@) if $@;
 
-       return "comment-".md5_hex($page);
+       return "comment-".md5_hex(Encode::encode_utf8(($page)));
 }
        
 package IkiWiki::PageSpec;