]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
smcvpostcomment: reduce length of subject field
[git.ikiwiki.info.git] / IkiWiki / Plugin / recentchanges.pm
index a73ff37b98f9f8ced928df004c96013017b676f2..4d7023c1c1e5a0af91aad4841eb85c817dfefab3 100644 (file)
@@ -5,6 +5,7 @@ use warnings;
 use strict;
 use IkiWiki 2.00;
 use Encode;
 use strict;
 use IkiWiki 2.00;
 use Encode;
+use HTML::Entities;
 
 sub import { #{{{
        hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
 
 sub import { #{{{
        hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
@@ -131,7 +132,7 @@ sub store ($$$) { #{{{
                                                do => "recentchanges_link",
                                                page => $_->{page}
                                        ).
                                                do => "recentchanges_link",
                                                page => $_->{page}
                                        ).
-                                       "\">".
+                                       "\" rel=\"nofollow\">".
                                        pagetitle($_->{page}).
                                        "</a>"
                        }
                                        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}) {
        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}, '\[\]');
                        }
                }
        }
                        }
                }
        }