diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index b278365c..7624eb81 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -418,7 +418,8 @@ class RoomsController < ApplicationController # Checks if the file extension is allowed def valid_file_type - Rails.configuration.allowed_file_types.split(",").include?(File.extname(room_params[:presentation].original_filename)) + Rails.configuration.allowed_file_types.split(",") + .include?(File.extname(room_params[:presentation].original_filename.downcase)) end # Gets the room setting based on the option set in the room configuration diff --git a/app/views/shared/modals/_preupload_presentation_modal.html.erb b/app/views/shared/modals/_preupload_presentation_modal.html.erb index fa3e1933..ffb4e797 100644 --- a/app/views/shared/modals/_preupload_presentation_modal.html.erb +++ b/app/views/shared/modals/_preupload_presentation_modal.html.erb @@ -34,7 +34,7 @@

<%= t("modal.preupload.invalid") %>

- <%= f.label :presentation, t("modal.preupload.choose", type: allowed_file_types), id:"presentation-upload-label", class: "custom-file-label", "data-placeholder": t("modal.preupload.choose", type: allowed_file_types) %> + <%= f.label :presentation, t("modal.preupload.choose"), id:"presentation-upload-label", class: "custom-file-label", "data-placeholder": t("modal.preupload.choose", type: allowed_file_types) %> <%= f.file_field :presentation, id: "presentation-upload", class: "custom-file-input cursor-pointer", accept: allowed_file_types, required: "true" %>
diff --git a/config/application.rb b/config/application.rb index 8fe4db4d..c310537d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -129,7 +129,7 @@ module Greenlight config.help_url = ENV["HELP_URL"].nil? ? "https://docs.bigbluebutton.org/greenlight/gl-overview.html" : ENV["HELP_URL"] # File types allowed in preupload presentation - config.allowed_file_types = ".doc,.docx,.pptx,.pdf" + config.allowed_file_types = ".doc,.docx,.ppt,.pptx,.pdf,.xls,.xlsx,.txt,.rtf,.odt,.ods,.odp,.odg,.odc,.odi,.jpg,.jpeg,.png" # DEFAULTS diff --git a/config/locales/en.yml b/config/locales/en.yml index 36443b4e..c99cd20a 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -411,7 +411,7 @@ en: forgot_password: Forgot Password? preupload: change: Replace Presentation - choose: Choose a file (%{type}) + choose: Choose a file... current: "Current Presentation:" footer: Depending on the size of the presentation, it may require additional time to upload before it can be used. invalid: Invalid size/file type. Please see the restrictions below. diff --git a/spec/controllers/rooms_controller_spec.rb b/spec/controllers/rooms_controller_spec.rb index 59b661ee..5036fa52 100644 --- a/spec/controllers/rooms_controller_spec.rb +++ b/spec/controllers/rooms_controller_spec.rb @@ -821,7 +821,7 @@ describe RoomsController, type: :controller do before do @user = create(:user) @file = fixture_file_upload('files/sample.pdf', 'application/pdf') - @invalid_file = fixture_file_upload('files/invalid.jpg', 'image/jpg') + @invalid_file = fixture_file_upload('files/invalid.bmp', 'image/bmp') allow(Rails.configuration).to receive(:preupload_presentation_default).and_return("true") end diff --git a/spec/fixtures/files/invalid.bmp b/spec/fixtures/files/invalid.bmp new file mode 100644 index 00000000..b61d3688 Binary files /dev/null and b/spec/fixtures/files/invalid.bmp differ diff --git a/spec/fixtures/files/invalid.jpg b/spec/fixtures/files/invalid.jpg deleted file mode 100644 index 1db39e04..00000000 Binary files a/spec/fixtures/files/invalid.jpg and /dev/null differ