diff options
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r-- | app/controllers/application.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 306ebc03c..25cf205f4 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -196,4 +196,9 @@ class ApplicationController < ActionController::Base end return tmp end + + # Returns a string that can be used as filename value in Content-Disposition header + def filename_for_content_disposition(name) + request.env['HTTP_USER_AGENT'] =~ %r{MSIE} ? ERB::Util.url_encode(name) : name + end end |