diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-11-18 02:43:17 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-11-18 02:43:17 -0500 |
commit | 15269fed646bf14692061e634969c98b614daaad (patch) | |
tree | 25517c9ef16f3ab3153d405df5971b0515359add /IkiWiki/Plugin/recentchangesdiff.pm | |
parent | 767bf9c4838277602b75522275c9f08d122f37a1 (diff) | |
download | ikiwiki-15269fed646bf14692061e634969c98b614daaad.tar ikiwiki-15269fed646bf14692061e634969c98b614daaad.tar.gz |
improve escaping of wikilinks and preprocessor directives
The old method failed for '[' x 3.
Diffstat (limited to 'IkiWiki/Plugin/recentchangesdiff.pm')
-rw-r--r-- | IkiWiki/Plugin/recentchangesdiff.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index 36acef72e..bc793bada 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -4,6 +4,7 @@ package IkiWiki::Plugin::recentchangesdiff; use warnings; use strict; use IkiWiki 2.00; +use HTML::Entities; my $maxlines=200; @@ -39,7 +40,7 @@ sub pagetemplate (@) { #{{{ $diff=join("", @lines); } # escape links and preprocessor stuff - $diff =~ s/(?<!\\)\[\[/\\\[\[/g; + $diff = encode_entities($diff, '\[\]'); $template->param(diff => $diff); } } |