From db4175c008a36c15ab72c5d28606506ef4a57ed1 Mon Sep 17 00:00:00 2001 From: Simone Rota Date: Sat, 18 Nov 2006 13:07:50 +0100 Subject: gitweb: mask email adddresses --- gitweb/gitweb.cgi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi index 518d64d..a21c174 100755 --- a/gitweb/gitweb.cgi +++ b/gitweb/gitweb.cgi @@ -195,6 +195,13 @@ sub gitweb_get_default_head { return "HEAD"; } +sub nospam { + my $committer = shift; + $committer =~ s/\./ dot /g; + $committer =~ s/\@/ at /g; + return $committer; +} + sub gitweb_check_feature { my ($name) = @_; return unless exists $feature{$name}; @@ -2862,7 +2869,7 @@ sub git_tag { "\n"; if (defined($tag{'author'})) { my %ad = parse_date($tag{'epoch'}, $tag{'tz'}); - print "author" . esc_html($tag{'author'}) . "\n"; + print "author" . esc_html(nospam($tag{'author'})) . "\n"; print "" . $ad{'rfc2822'} . sprintf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'}) . "\n"; @@ -3458,7 +3465,7 @@ sub git_commit { } print "
\n" . "\n"; - print "\n". + print "\n". "" . "" . "\n"; - print "\n"; + print "\n"; print "\n"; -- cgit v1.2.3
author" . esc_html($co{'author'}) . "
author" . esc_html(nospam($co{'author'})) . "
$ad{'rfc2822'}"; if ($ad{'hour_local'} < 6) { @@ -3470,7 +3477,7 @@ sub git_commit { } print "
committer" . esc_html($co{'committer'}) . "
committer" . esc_html(nospam($co{'committer'})) . "
$cd{'rfc2822'}" . sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) . "