[Rt-commit] rt branch, 4.0/disable-att-quote-folding, created. rt-4.0.0-282-g285b1a0

Thomas Sibley trs at bestpractical.com
Fri May 13 12:21:46 EDT 2011


On 05/13/2011 04:23 AM, ? sunnavy wrote:
> commit d2762b27d8723bd51791cfed7be8a0e3e8163130
> Author: sunnavy <sunnavy at bestpractical.com>
> Date:   Fri May 13 15:44:24 2011 +0800
> 
>     disable attachments' quote folding
>     
>     think about .diff files for example
> 
> diff --git a/share/html/Ticket/Elements/ShowTransactionAttachments b/share/html/Ticket/Elements/ShowTransactionAttachments
> index b503346..ecbbc12 100644
> --- a/share/html/Ticket/Elements/ShowTransactionAttachments
> +++ b/share/html/Ticket/Elements/ShowTransactionAttachments
> @@ -144,6 +144,8 @@ my $render_attachment = sub {
>  
>      # if it has a content-disposition: attachment, don't show inline
>      my $disposition = $message->GetHeader('Content-Disposition');
> +    my $has_name = $disposition && $disposition =~ /filename=.+/ ? 1 : 0;
> +

The more correct check for filename is to use the logic from
MIME::Head::recommended_filename: check for the filename attribute in
Content-Disposition, and then the name attribute of Content-Type.

>      if ( $disposition && $disposition =~ /attachment/i && $disposition !~ /^\s*inline/ ) {
>          $disposition = 'attachment';
>      } else {

Not your code, but the above if condition needs to get fixed.  I'll just
commit to this branch to avoid conflicts.


More information about the Rt-commit mailing list