]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
Merge commit 'upstream/master' into pub/master
[git.ikiwiki.info.git] / IkiWiki / Plugin / recentchanges.pm
index 781e297230460bcae757f68ec79a593a4fb876c1..4d7023c1c1e5a0af91aad4841eb85c817dfefab3 100644 (file)
@@ -5,6 +5,7 @@ use warnings;
 use strict;
 use IkiWiki 2.00;
 use Encode;
+use HTML::Entities;
 
 sub import { #{{{
        hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
@@ -131,7 +132,7 @@ sub store ($$$) { #{{{
                                                do => "recentchanges_link",
                                                page => $_->{page}
                                        ).
-                                       "\">".
+                                       "\" rel=\"nofollow\">".
                                        pagetitle($_->{page}).
                                        "</a>"
                        }
@@ -159,11 +160,13 @@ sub store ($$$) { #{{{
                );
        }
 
-       # escape wikilinks and preprocessor stuff in commit messages
        if (ref $change->{message}) {
                foreach my $field (@{$change->{message}}) {
                        if (exists $field->{line}) {
-                               $field->{line} =~ s/(?<!\\)\[\[/\\\[\[/g;
+                               # escape html
+                               $field->{line} = encode_entities($field->{line});
+                               # escape links and preprocessor stuff
+                               $field->{line} = encode_entities($field->{line}, '\[\]');
                        }
                }
        }
@@ -173,7 +176,6 @@ sub store ($$$) { #{{{
        $template->param(
                %$change,
                commitdate => displaytime($change->{when}, "%X %x"),
-               commitdate_raw => scalar localtime($change->{when}),
                wikiname => $config{wikiname},
        );