summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormyk%mozilla.org <>2003-08-01 12:57:19 +0200
committermyk%mozilla.org <>2003-08-01 12:57:19 +0200
commit193c5ac6be8e883c57e4caf3c87b181db0351be0 (patch)
treed7a28654e54352fa344dbfef480f9223ee889704
parent393dfb830acf397c180b81e333c93b0d4d76258c (diff)
downloadbugzilla-193c5ac6be8e883c57e4caf3c87b181db0351be0.tar.gz
bugzilla-193c5ac6be8e883c57e4caf3c87b181db0351be0.tar.xz
Partial fix for bug 120030: adds template filter for obscuring email addresses.
Patch by Stephen Lee <slee@@wilcoxassoc.com>. r=myk,a=myk
-rw-r--r--Bugzilla/Template.pm8
-rwxr-xr-xchecksetup.pl1
-rw-r--r--t/004template.t1
3 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 6c3e2161a..d5cb1afd7 100644
--- a/Bugzilla/Template.pm
+++ b/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/\@/\&#64;/g;
+ return $var;
+ },
},
PLUGIN_BASE => 'Bugzilla::Template::Plugin',
diff --git a/checksetup.pl b/checksetup.pl
index fb6214ff6..d0b1764b4 100755
--- a/checksetup.pl
+++ b/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/t/004template.t b/t/004template.t
index 8429b774f..35965aa11 100644
--- a/t/004template.t
+++ b/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 $_ } ,
},
}
);