summaryrefslogtreecommitdiff
path: root/rt/share/html/Ticket/Elements/ShowTransactionAttachments
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-02-25 18:34:25 -0800
committerIvan Kohler <ivan@freeside.biz>2014-03-01 16:26:03 -0800
commitb8988e1d3ac75af63c85e8563e57701030315a9e (patch)
treedb1eb8de0d989314c493de16f1a480cacb0dd57f /rt/share/html/Ticket/Elements/ShowTransactionAttachments
parent7f029e082712dceafb9152820746da79a50f2275 (diff)
RT 4.0.19
Diffstat (limited to 'rt/share/html/Ticket/Elements/ShowTransactionAttachments')
-rw-r--r--rt/share/html/Ticket/Elements/ShowTransactionAttachments29
1 files changed, 24 insertions, 5 deletions
diff --git a/rt/share/html/Ticket/Elements/ShowTransactionAttachments b/rt/share/html/Ticket/Elements/ShowTransactionAttachments
index bf9aad054..4e9fd60de 100644
--- a/rt/share/html/Ticket/Elements/ShowTransactionAttachments
+++ b/rt/share/html/Ticket/Elements/ShowTransactionAttachments
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -216,8 +216,17 @@ my $render_attachment = sub {
ticket => $Ticket,
);
- require HTML::Quoted;
- $content = HTML::Quoted->extract($content) unless length $name;
+ unless (length $name) {
+ eval {
+ require HTML::Quoted;
+ $content = HTML::Quoted->extract($content)
+ };
+ if ($@) {
+ RT->Logger->error(
+ "HTML::Quoted couldn't process attachment #@{[$message->id]}: $@."
+ . " This is a bug, please report it to rt-bugs\@bestpractical.com.");
+ }
+ }
$m->comp(
'ShowMessageStanza',
@@ -235,8 +244,18 @@ my $render_attachment = sub {
# It's a text type we don't have special handling for
else {
unless ( length $name ) {
- eval { require Text::Quoted; $content = Text::Quoted::extract($content); };
- if ($@) { $RT::Logger->warning( "Text::Quoted failed: $@" ) }
+ eval {
+ require Text::Quoted;
+ # XXX: Deprecate ->can check in 4.2 and simply bump version requirement.
+ Text::Quoted::set_quote_characters(undef) # only use >
+ if Text::Quoted->can("set_quote_characters");
+ $content = Text::Quoted::extract($content);
+ };
+ if ($@) {
+ RT->Logger->error(
+ "Text::Quoted couldn't process attachment #@{[$message->id]}: $@."
+ . " This is a bug, please report it to rt-bugs\@bestpractical.com.");
+ }
}
$m->comp(