diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template.pm b/mozilla/webtools/bugzilla/Bugzilla/Template.pm index 6c3e2161a52..d5cb1afd790 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template.pm @@ -244,6 +244,14 @@ sub create { # Format a time for display (more info in Bugzilla::Util) time => \&Bugzilla::Util::format_time, + + # Simple filter to obscure the '@' in user visible strings + # See bug 120030 for details + obscure_email => sub { + my ($var) = @_; + $var =~ s/\@/\@/g; + return $var; + }, }, PLUGIN_BASE => 'Bugzilla::Template::Plugin', diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index fb6214ff633..d0b1764b4c0 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -1057,6 +1057,7 @@ END bug_link => [ sub { return sub { return $_; } }, 1], csv => sub { return $_; }, time => sub { return $_; }, + obscure_email => sub { return $_; }, }, }) || die ("Could not create Template Provider: " . Template::Provider->error() . "\n"); diff --git a/mozilla/webtools/bugzilla/t/004template.t b/mozilla/webtools/bugzilla/t/004template.t index 8429b774f8e..35965aa1153 100644 --- a/mozilla/webtools/bugzilla/t/004template.t +++ b/mozilla/webtools/bugzilla/t/004template.t @@ -97,6 +97,7 @@ foreach my $include_path (@include_paths) { bug_link => [ sub { return sub { return $_; } }, 1] , csv => sub { return $_ } , time => sub { return $_ } , + obscure_email => sub { return $_ } , }, } );