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/aggregate.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/aggregate.pm')
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index f256b3ac1..6cdbbc0e9 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -610,7 +610,7 @@ sub add_page (@) { #{{{ my $template=template($feed->{template}, blind_cache => 1); $template->param(title => $params{title}) if defined $params{title} && length($params{title}); - $template->param(content => htmlescape(htmlabs($params{content}, + $template->param(content => wikiescape(htmlabs($params{content}, defined $params{base} ? $params{base} : $feed->{feedurl}))); $template->param(name => $feed->{name}); $template->param(url => $feed->{url}); @@ -637,11 +637,9 @@ sub add_page (@) { #{{{ } } #}}} -sub htmlescape ($) { #{{{ +sub wikiescape ($) { #{{{ # escape accidental wikilinks and preprocessor stuff - my $html=shift; - $html=~s/(?<!\\)\[\[/\\\[\[/g; - return $html; + return encode_entities(shift, '\[\]'); } #}}} sub urlabs ($$) { #{{{ |