X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4fb26f4e60f2df282fc972e4b8506ccd306de789..8d4342183b1c3a96797def6fff96feebacb90db6:/IkiWiki/Plugin/darcs.pm diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index cd4fcd0ff..9dccd95a4 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -3,6 +3,7 @@ package IkiWiki::Plugin::darcs; use warnings; use strict; +use URI::Escape q{uri_escape_utf8}; use IkiWiki; sub import { @@ -146,10 +147,10 @@ sub commitauthor (@) { my $author="anon\@web"; if (defined $params{session}) { if (defined $params{session}->param("name")) { - return $params{session}->param("name").'@web'; + return IkiWiki::cloak($params{session}->param("name")).'@web'; } elsif (defined $params{session}->remote_addr()) { - return $params{session}->remote_addr().'@web'; + return IkiWiki::cloak($params{session}->remote_addr()).'@web'; } } return 'anon@web'; @@ -336,7 +337,8 @@ sub rcs_recentchanges ($) { foreach my $f (@files) { my $d = defined $config{'diffurl'} ? $config{'diffurl'} : ""; - $d =~ s/\[\[file\]\]/$f/go; + my $ef = uri_escape_utf8($f); + $d =~ s/\[\[file\]\]/$ef/go; $d =~ s/\[\[hash\]\]/$hash/go; push @pg, { @@ -377,7 +379,8 @@ sub rcs_diff ($;$) { my $rev=shift; my $maxlines=shift; my @lines; - foreach my $line (silentsystem("darcs", "diff", "--match", "hash ".$rev)) { + my $repodir=$config{srcdir}; + foreach my $line (`darcs diff --repodir $repodir --match 'hash $rev'`) { if (@lines || $line=~/^diff/) { last if defined $maxlines && @lines == $maxlines; push @lines, $line."\n";