]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Partial fix for bug 120030: adds template filter for obscuring email addresses.
authormyk%mozilla.org <>
Fri, 1 Aug 2003 10:57:19 +0000 (10:57 +0000)
committermyk%mozilla.org <>
Fri, 1 Aug 2003 10:57:19 +0000 (10:57 +0000)
Patch by Stephen Lee <slee@@wilcoxassoc.com>.
r=myk,a=myk

Bugzilla/Template.pm
checksetup.pl
t/004template.t

index 6c3e2161a524bb82b1bcc9cdf000e232f573126c..d5cb1afd790689b927d1a2e9d16033af8021c0b0 100644 (file)
@@ -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',
index fb6214ff6336182b74b1a9dd27f2f0bbcab07d08..d0b1764b4c0fd6dd70cf6c3d1158a8829831fcb4 100755 (executable)
@@ -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");
index 8429b774f8e80697d5548c85ed70224367f7d9b2..35965aa1153affc7da54390dc7df4a8302e933ab 100644 (file)
@@ -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 $_ } ,
         },
     }
     );