Defect #26599 » 0001-Fix-file-name-corruption-when-export-a-wiki-page-wit.patch
app/controllers/wiki_controller.rb | ||
---|---|---|
100 | 100 | |
101 | 101 |
if User.current.allowed_to?(:export_wiki_pages, @project) |
102 | 102 |
if params[:format] == 'pdf' |
103 |
send_file_headers! :type => 'application/pdf', :filename => "#{@page.title}.pdf"
|
|
103 |
send_file_headers! :type => 'application/pdf', :filename => filename_for_content_disposition("#{@page.title}.pdf")
|
|
104 | 104 |
return |
105 | 105 |
elsif params[:format] == 'html' |
106 | 106 |
export = render_to_string :action => 'export', :layout => false |
107 |
send_data(export, :type => 'text/html', :filename => "#{@page.title}.html")
|
|
107 |
send_data(export, :type => 'text/html', :filename => filename_for_content_disposition("#{@page.title}.html"))
|
|
108 | 108 |
return |
109 | 109 |
elsif params[:format] == 'txt' |
110 |
send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
|
|
110 |
send_data(@content.text, :type => 'text/plain', :filename => filename_for_content_disposition("#{@page.title}.txt"))
|
|
111 | 111 |
return |
112 | 112 |
end |
113 | 113 |
end |