summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-09-23 16:24:26 +0200
committerByron Jones <bjones@mozilla.com>2013-09-23 16:24:26 +0200
commitd6f683c849a41d1fc76f714f77cfaa8db3c0379c (patch)
tree5d4df55510285b7065c63af0dc4f5e1e8e90cead /extensions
parent32f6822ce514402024e8fd5e32297f801cad2da2 (diff)
downloadbugzilla-d6f683c849a41d1fc76f714f77cfaa8db3c0379c.tar.gz
bugzilla-d6f683c849a41d1fc76f714f77cfaa8db3c0379c.tar.xz
Bug 919041: Remove BMO feature which alters content-type on attachments from users without editbugs
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BMO/Extension.pm25
1 files changed, 0 insertions, 25 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 2129e675d..3aaa26afb 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -606,31 +606,6 @@ sub quicksearch_map {
}
}
-# Restrict content types attachable by non-privileged people
-my @mimetype_whitelist = ('^image\/', 'application\/pdf');
-
-sub object_end_of_create_validators {
- my ($self, $args) = @_;
- my $class = $args->{'class'};
-
- if ($class->isa('Bugzilla::Attachment')) {
- my $params = $args->{'params'};
- my $bug = $params->{'bug'};
- if (!Bugzilla->user->in_group('editbugs', $bug->product_id)) {
- my $mimetype = $params->{'mimetype'};
- if (!grep { $mimetype =~ /$_/ } @mimetype_whitelist ) {
- # Need to neuter MIME type to something non-executable
- if ($mimetype =~ /^text\//) {
- $params->{'mimetype'} = "text/plain";
- }
- else {
- $params->{'mimetype'} = "application/octet-stream";
- }
- }
- }
- }
-}
-
sub object_end_of_create {
my ($self, $args) = @_;
if ($args->{class} eq 'Bugzilla::User') {