diff options
Diffstat (limited to 'IkiWiki/Plugin/meta.pm')
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 28b1a1ad6..b19ea2b32 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -285,6 +285,13 @@ sub preprocess (@) { join(' ', map { "$_=\"$params{$_}\"" } keys %params). ' />', $page, $destpage); } + elsif ($key eq 'keywords') { + # Make sure the keyword string is safe: only allow alphanumeric + # characters, space and comma and strip the rest. + $value =~ s/[^[:alnum:], ]+//g; + push @{$metaheaders{$page}}, '<meta name="keywords"'. + ' content="'.encode_entities($value).'" />'; + } else { push @{$metaheaders{$page}}, scrub('<meta name="'. encode_entities($key).'" content="'. |