Module: bugzilla Branch: master Commit: 03fd95d16e0a651bc474fee9ee8a79e59c534dae URL: http://source.winehq.org/git/bugzilla.git/?a=commit;h=03fd95d16e0a651bc474fe...
Author: Lei Zhang thestig@google.com Date: Sat Mar 15 10:38:59 2008 -0700
bugzilla: set mime types for log files as text/plain
Hi,
Every time bugzilla detects an attachment as a log file, someone needs to manually change it to text/plain to make it viewable in the browser. This is rather annoying.
From 9bd8b5e3fc08963bc245acab3d8b6da490506b6d Mon Sep 17 00:00:00 2001
From: Lei Zhang thestig@google.com Date: Sat, 15 Mar 2008 10:28:44 -0700 Subject: [PATCH] bugzilla: set mime types for log files as text/plain
---
Bugzilla/Attachment.pm | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index a08c0d5..fa2994d 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -578,6 +578,10 @@ sub validate_content_type { if ( !$contenttype ) { $throw_error ? ThrowUserError("missing_content_type") : return 0; } + + if ($contenttype eq 'text/x-log') { + $contenttype = 'text/plain'; + } $cgi->param('contenttype', $contenttype); } elsif ($cgi->param('contenttypemethod') eq 'list') {