diff options
author | timeless%mozdev.org <> | 2007-07-20 08:16:15 +0000 |
---|---|---|
committer | timeless%mozdev.org <> | 2007-07-20 08:16:15 +0000 |
commit | 2b68a4d9128233c7db6cbb5b38af7ebf16c6b982 (patch) | |
tree | 99df7a826ce4666c218fd524cfd2dc06205d49da | |
parent | 03714c5aa950e2f24d8ff397b9401e0e7a38ad73 (diff) | |
download | bugs-2b68a4d9128233c7db6cbb5b38af7ebf16c6b982.tar bugs-2b68a4d9128233c7db6cbb5b38af7ebf16c6b982.tar.gz bugs-2b68a4d9128233c7db6cbb5b38af7ebf16c6b982.tar.bz2 bugs-2b68a4d9128233c7db6cbb5b38af7ebf16c6b982.tar.xz bugs-2b68a4d9128233c7db6cbb5b38af7ebf16c6b982.zip |
Bug 365756 text/x-patch and text/x-diff should be mapped to [x] patch
r=lpsolit a=lpsolit
-rw-r--r-- | Bugzilla/Attachment.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 09dd3c887..5f669deb3 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -748,6 +748,15 @@ sub insert_attachment_for_bug { # we now check the content type for image/bmp in _validate_data() unless ($cgi->param('ispatch')) { $class->validate_content_type($throw_error) || return; + + # Set the ispatch flag to 1 if we're set to autodetect + # and the content type is text/x-diff or text/x-patch + if ($cgi->param('contenttypemethod') eq 'autodetect' + && $cgi->param('contenttype') =~ m{text/x-(?:diff|patch)}) + { + $cgi->param('ispatch', 1); + $cgi->param('contenttype', 'text/plain'); + } } $data = _validate_data($throw_error, $hr_vars); # If the attachment is stored locally, $data eq ''. |