summaryrefslogtreecommitdiffstats
path: root/app/controllers/application.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-10 22:42:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-10 22:42:41 +0000
commit941f9bf3dd3bfbbb575cd5f56d52a52fdf173eba (patch)
tree6f8e23e74a755f9370cea6fe53a3b5fb5d809ed4 /app/controllers/application.rb
parenta39f655a7c86fab775e725505f262692ced2c2ca (diff)
downloadredmine-941f9bf3dd3bfbbb575cd5f56d52a52fdf173eba.tar.gz
redmine-941f9bf3dd3bfbbb575cd5f56d52a52fdf173eba.zip
Non-ascii attachement filename fix for IE.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1053 e93f8b46-1217-0410-a6f0-8f06a7374b81
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