From e96e3a53a85675cc79b489f7f06cf35393c33efa Mon Sep 17 00:00:00 2001 From: Seiei Miyagi Date: Fri, 29 Nov 2019 02:06:06 +0900 Subject: [PATCH] Fix ruby 2.7 warning: given argument is nil; this will raise a TypeError in the next release --- app/controllers/application_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea579bfa8..b3f47a05b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -644,6 +644,8 @@ def parse_qvalues(value) # Returns a string that can be used as filename value in Content-Disposition header def filename_for_content_disposition(name) + return name unless request.env['HTTP_USER_AGENT'] + %r{(MSIE|Trident|Edge)}.match?(request.env['HTTP_USER_AGENT']) ? ERB::Util.url_encode(name) : name end -- 2.24.0