From: Simon McVittie Date: Wed, 21 Mar 2018 08:58:19 +0000 (+0000) Subject: preprocess: Don't encode digit zero as an entity in errors X-Git-Tag: 3.20190207~195 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/f2b248cdfd2515dbc8556e26442da6a0ac08e911 preprocess: Don't encode digit zero as an entity in errors I'm not sure what happened here, but it seems to have been the wrong thing. Whitelist what we want to *not* encode instead. Signed-off-by: Simon McVittie --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 7a38c8f89..90cb96e58 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1667,11 +1667,10 @@ sub preprocess ($$$;$$) { my $error=$@; chomp $error; eval q{use HTML::Entities}; - $error = encode_entities($error); # Also encode most ASCII punctuation # as entities so that error messages # are not interpreted as Markdown etc. - $error = encode_entities($error, '[](){}!#$%*?@^`|~'."\\"); + $error = encode_entities($error, '^-A-Za-z0-9+_,./:;= '."'"); $ret="[[!$command ". gettext("Error").": $error"."]]"; }