summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-11-18 02:48:24 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-11-18 02:48:24 -0500
commite307eeda3d55446f4bdeb2ac48f4fef0c24b1f3d (patch)
tree296ce737b575876a97c111b26d913d7ec72a20b1 /IkiWiki/Plugin
parent15269fed646bf14692061e634969c98b614daaad (diff)
html escaping complication
Can't escape things to entities if the template then escapes the entities. (aggregate doesn't have this problem.)
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/recentchanges.pm4
-rw-r--r--IkiWiki/Plugin/recentchangesdiff.pm2
2 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index 39a123ccf..4d7023c1c 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -160,10 +160,12 @@ sub store ($$$) { #{{{
);
}
- # escape wikilinks and preprocessor stuff in commit messages
if (ref $change->{message}) {
foreach my $field (@{$change->{message}}) {
if (exists $field->{line}) {
+ # escape html
+ $field->{line} = encode_entities($field->{line});
+ # escape links and preprocessor stuff
$field->{line} = encode_entities($field->{line}, '\[\]');
}
}
diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm
index bc793bada..08cec3f5a 100644
--- a/IkiWiki/Plugin/recentchangesdiff.pm
+++ b/IkiWiki/Plugin/recentchangesdiff.pm
@@ -39,6 +39,8 @@ sub pagetemplate (@) { #{{{
else {
$diff=join("", @lines);
}
+ # escape html
+ $diff = encode_entities($diff);
# escape links and preprocessor stuff
$diff = encode_entities($diff, '\[\]');
$template->param(diff => $diff);