X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FElements%2FShowTransactionAttachments;h=477a81ae5e5ddfbcb6b25aa90cf20933089aa70d;hb=2c09925cad2ade037e6ae953e4ed6fc056811f2f;hp=bf9aad05400357b4f75cc1ea0e8df7533d34c82a;hpb=7588a4ac90a9b07c08a3107cd1107d773be1c991;p=freeside.git diff --git a/rt/share/html/Ticket/Elements/ShowTransactionAttachments b/rt/share/html/Ticket/Elements/ShowTransactionAttachments index bf9aad054..477a81ae5 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-2015 Best Practical Solutions, LLC %# %# %# (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(