]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
Untested backport to Ubuntu trusty.
[git.ikiwiki.info.git] / IkiWiki.pm
index 6e19d482a899073fd790baef18d44d78e389e9f0..fa71f479107a2388fde2fe00a67bfa2daa4fb3a9 100644 (file)
@@ -566,6 +566,14 @@ sub getsetup () {
                safe => 1,
                rebuild => 1,
        },
+       deterministic => {
+               type => "boolean",
+               default => 0,
+               description => "try harder to produce deterministic output",
+               safe => 1,
+               rebuild => 1,
+               advanced => 1,
+       },
 }
 
 sub getlibdirs () {
@@ -835,10 +843,9 @@ sub log_message ($$) {
                        $log_open=1;
                }
                eval {
-                       # keep a copy to avoid editing the original config repeatedly
-                       my $wikiname = $config{wikiname};
-                       utf8::encode($wikiname);
-                       Sys::Syslog::syslog($type, "[$wikiname] %s", join(" ", @_));
+                       my $message = "[$config{wikiname}] ".join(" ", @_);
+                       utf8::encode($message);
+                       Sys::Syslog::syslog($type, "%s", $message);
                };
                 if ($@) {
                     print STDERR "failed to syslog: $@" unless $log_failed;
@@ -1640,6 +1647,8 @@ sub preprocess ($$$;$$) {
                                if ($@) {
                                        my $error=$@;
                                        chomp $error;
+                                       eval q{use HTML::Entities};
+                                       $error = encode_entities($error);
                                        $ret="[[!$command <span class=\"error\">".
                                                gettext("Error").": $error"."</span>]]";
                                }