From: Go MAEDA Date: Sat, 30 Nov 2019 05:40:40 +0000 (+0000) Subject: Ruby 2.7: Regexp#match and Regexp#match? with a nil argument are deprecated (#32527... X-Git-Tag: 4.2.0~1316 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f7fcd111e9b0e127950634435bf4e63d0f69d4bf;p=redmine.git Ruby 2.7: Regexp#match and Regexp#match? with a nil argument are deprecated (#32527, #31500). git-svn-id: http://svn.redmine.org/redmine/trunk@19324 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea579bfa8..88ba2674e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -644,7 +644,7 @@ class ApplicationController < ActionController::Base # Returns a string that can be used as filename value in Content-Disposition header def filename_for_content_disposition(name) - %r{(MSIE|Trident|Edge)}.match?(request.env['HTTP_USER_AGENT']) ? ERB::Util.url_encode(name) : name + %r{(MSIE|Trident|Edge)}.match?(request.env['HTTP_USER_AGENT'].to_s) ? ERB::Util.url_encode(name) : name end def api_request?