From dcbcdb1ed71883f8a88eda28f89d8835c38c514e Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 3 Aug 2011 02:23:57 +0000 Subject: [PATCH] avoid corrupt attachments, #13209 and #13877 --- httemplate/view/attachment.html | 5 ++--- rt/share/html/Ticket/Attachment/dhandler | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httemplate/view/attachment.html b/httemplate/view/attachment.html index 5fc053967..5827e3d20 100644 --- a/httemplate/view/attachment.html +++ b/httemplate/view/attachment.html @@ -1,4 +1,3 @@ -<% $attach->body %> <%init> my ($query) = $cgi->keywords; $query =~ /^(\d+)$/; @@ -8,9 +7,9 @@ $FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'acces my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die "Attachment not found: $attachnum"; die 'access denied' if $attach->disabled; +$r->subprocess_env('no-gzip' => 1); # disable mod_deflate $m->clear_buffer; $r->content_type($attach->mime_type || 'text/plain'); $r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename); - - +$m->print($attach->body); diff --git a/rt/share/html/Ticket/Attachment/dhandler b/rt/share/html/Ticket/Attachment/dhandler index 529708284..9d4d5322c 100755 --- a/rt/share/html/Ticket/Attachment/dhandler +++ b/rt/share/html/Ticket/Attachment/dhandler @@ -85,6 +85,7 @@ # $content_type = 'application/octet-stream'; # } + $r->subprocess_env('no-gzip' => 1); # disable mod_deflate $r->content_type( $content_type ); $m->clear_buffer(); $m->out($AttachmentObj->OriginalContent); -- 2.11.0