]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
preprocess: Don't encode digit zero as an entity in errors
authorSimon McVittie <smcv@debian.org>
Wed, 21 Mar 2018 08:58:19 +0000 (08:58 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 21 Mar 2018 09:33:04 +0000 (09:33 +0000)
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 <smcv@debian.org>
IkiWiki.pm

index 7a38c8f89a44fd42d7e61a2871dd2014e4ac3b09..90cb96e5865ba193db122ce42ea7d4cb449bb49f 100644 (file)
@@ -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 <span class=\"error\">".
                                                gettext("Error").": $error"."</span>]]";
                                }