From 3733aa3b7e6a339093b2f02f227ccee3478af910 Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 19 Jun 2024 13:25:28 +0200 Subject: [PATCH] Fix opening of wopi files with extensions written in upper case [SCI-10786] --- app/models/asset.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/asset.rb b/app/models/asset.rb index ce981c919..10db504b7 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -245,7 +245,7 @@ class Asset < ApplicationRecord def can_perform_action(action) if ENV['WOPI_ENABLED'] == 'true' - file_ext = file_name.split('.').last + file_ext = file_name.split('.').last&.downcase if file_ext == 'wopitest' && (!ENV['WOPI_TEST_ENABLED'] || ENV['WOPI_TEST_ENABLED'] == 'false') @@ -297,7 +297,7 @@ class Asset < ApplicationRecord end def favicon_url(action) - file_ext = file_name.split('.').last + file_ext = file_name.split('.').last&.downcase action = get_action(file_ext, action) action[:icon] if action[:icon] end