summaryrefslogtreecommitdiffstats
path: root/extensions/SecureMail/Extension.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-08-23 21:45:53 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-08-23 21:45:53 +0200
commitae25abcc31888afd2a5ca47e8d3d64c701155696 (patch)
tree8821a129fa20e90b86378595f0302bd242b769c8 /extensions/SecureMail/Extension.pm
parent59fc67aa8f4a4a00037d01107da07da5e82c8127 (diff)
downloadbugzilla-ae25abcc31888afd2a5ca47e8d3d64c701155696.tar.gz
bugzilla-ae25abcc31888afd2a5ca47e8d3d64c701155696.tar.xz
Bug 775275 - Port HTML email support from Bugzilla 4.2 to BMO 4.0
- Added fix for filter bug links issue ported to bmo/4.0 - Removed need to check for 4.2 for HTML::Tree
Diffstat (limited to 'extensions/SecureMail/Extension.pm')
-rw-r--r--extensions/SecureMail/Extension.pm15
1 files changed, 6 insertions, 9 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index 2138864e0..d4d29b5c0 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -46,12 +46,6 @@ use constant SECURE_NONE => 0;
use constant SECURE_BODY => 1;
use constant SECURE_ALL => 2;
-our $FILTER_BUG_LINKS = 1;
-if(vers_cmp(BUGZILLA_VERSION, '4.2') > -1) {
- eval "require HTML::Tree";
- $FILTER_BUG_LINKS = 0 if $@;
-}
-
##############################################################################
# Creating new columns
#
@@ -305,7 +299,7 @@ sub mailer_before_send {
# Filter the bug_links in HTML email in case the bugs the links
# point are "secured" bugs and the user may not be able to see
# the summaries.
- _filter_bug_links($email) if $FILTER_BUG_LINKS;
+ _filter_bug_links($email);
}
else {
_make_secure($email, $public_key, $is_bugmail && $make_secure == SECURE_ALL, $add_new);
@@ -534,7 +528,7 @@ sub _filter_bug_links {
$email->walk_parts(sub {
my $part = shift;
return if $part->content_type !~ /text\/html/;
- my$body = $part->body;
+ my $body = $part->body;
my $tree = HTML::Tree->new->parse_content($body);
my @links = $tree->look_down( _tag => q{a}, class => qr/bz_bug_link/ );
foreach my $link (@links) {
@@ -546,7 +540,10 @@ sub _filter_bug_links {
$link->attr('class', 'bz_bug_link');
}
}
- $part->body_set($tree->as_HTML);
+ $body = $tree->as_HTML;
+ $part->body_set($body);
+ $part->charset_set('UTF-8') if Bugzilla->params->{'utf8'};
+ $part->encoding_set('quoted-printable');
});
}