summaryrefslogtreecommitdiffstats
path: root/app/controllers/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r--app/controllers/application.rb5
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