From 7a4f43e079d1eaa6eff61fa5055c02e71483f24e Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Tue, 1 Aug 2017 20:59:15 +0900 Subject: [PATCH 1/2] Fix file name corruption when export a wiki page with non-ASCII title in MS browsers. --- app/controllers/wiki_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 25e59adb0..b43b933cd 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -100,14 +100,14 @@ class WikiController < ApplicationController if User.current.allowed_to?(:export_wiki_pages, @project) if params[:format] == 'pdf' - send_file_headers! :type => 'application/pdf', :filename => "#{@page.title}.pdf" + send_file_headers! :type => 'application/pdf', :filename => filename_for_content_disposition("#{@page.title}.pdf") return elsif params[:format] == 'html' export = render_to_string :action => 'export', :layout => false - send_data(export, :type => 'text/html', :filename => "#{@page.title}.html") + send_data(export, :type => 'text/html', :filename => filename_for_content_disposition("#{@page.title}.html")) return elsif params[:format] == 'txt' - send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt") + send_data(@content.text, :type => 'text/plain', :filename => filename_for_content_disposition("#{@page.title}.txt")) return end end -- 2.11.0 (Apple Git-81)