]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/mercurial.pm
Add modified opengraph plugin.
[git.ikiwiki.info.git] / IkiWiki / Plugin / mercurial.pm
index b7fe01485aff129c3f672b8995bfedede2e959fb..9f0c5b721ccf13b26325eb5ba299ddbb4f0b7f2b 100644 (file)
@@ -5,6 +5,7 @@ use warnings;
 use strict;
 use IkiWiki;
 use Encode;
+use URI::Escape q{uri_escape_utf8};
 use open qw{:utf8 :std};
 
 sub import {
@@ -182,10 +183,10 @@ sub rcs_commit_helper (@) {
        my $user="Anonymous";
        if (defined $params{session}) {
                if (defined $params{session}->param("name")) {
-                       $user = $params{session}->param("name");
+                       $user = IkiWiki::cloak($params{session}->param("name"));
                }
                elsif (defined $params{session}->remote_addr()) {
-                       $user = $params{session}->remote_addr();
+                       $user = IkiWiki::cloak($params{session}->remote_addr());
                }
 
                my $nickname=$user;
@@ -265,7 +266,8 @@ sub rcs_recentchanges ($) {
 
                foreach my $file (split / /,$info->{files}) {
                        my $diffurl = defined $config{diffurl} ? $config{'diffurl'} : "";
-                       $diffurl =~ s/\[\[file\]\]/$file/go;
+                       my $efile = uri_escape_utf8($file);
+                       $diffurl =~ s/\[\[file\]\]/$efile/go;
                        $diffurl =~ s/\[\[r2\]\]/$info->{changeset}/go;
 
                        push @pages, {