X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/862ca19eb1aee87e4ac05e8a5a9b326dd32dfe5d..a605ee2c562323dc29852787c48a28bd03706718:/IkiWiki/Plugin/recentchangesdiff.pm diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index 3942f308b..08cec3f5a 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -4,14 +4,25 @@ package IkiWiki::Plugin::recentchangesdiff; use warnings; use strict; use IkiWiki 2.00; +use HTML::Entities; my $maxlines=200; sub import { #{{{ + hook(type => "getsetup", id => "recentchangesdiff", + call => \&getsetup); hook(type => "pagetemplate", id => "recentchangesdiff", call => \&pagetemplate); } #}}} +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => 1, + }, +} #}}} + sub pagetemplate (@) { #{{{ my %params=@_; my $template=$params{template}; @@ -28,8 +39,10 @@ sub pagetemplate (@) { #{{{ else { $diff=join("", @lines); } + # escape html + $diff = encode_entities($diff); # escape links and preprocessor stuff - $diff =~ s/(?param(diff => $diff); } }