X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FElements%2FShowTransactionAttachments;h=4e9fd60de1b1d075c086f5fcb2635fb69a8b322f;hb=b8988e1d3ac75af63c85e8563e57701030315a9e;hp=95a23411bdbc423de6f8f2d6f230f3c440ea26ba;hpb=0bff2e665b3a6389b47510e4c04a5a454f6dd7d4;p=freeside.git diff --git a/rt/share/html/Ticket/Elements/ShowTransactionAttachments b/rt/share/html/Ticket/Elements/ShowTransactionAttachments index 95a23411b..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-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 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( @@ -257,12 +276,13 @@ my $render_attachment = sub { } my $filename = length $name ? $name : loc('(untitled)'); + my $efilename = $m->interp->apply_escapes( $filename, 'h' ); $m->out('