Mercurial > hg > soundsoftware-site
diff app/controllers/repositories_controller.rb @ 1209:1b1138f6f55e
Merge from branch live
author | Chris Cannam |
---|---|
date | Wed, 23 Jan 2013 13:11:25 +0000 |
parents | 997f6d7738f7 |
children | bb32da3bea34 |
line wrap: on
line diff
--- a/app/controllers/repositories_controller.rb Wed Nov 21 17:56:50 2012 +0000 +++ b/app/controllers/repositories_controller.rb Wed Jan 23 13:11:25 2013 +0000 @@ -143,15 +143,14 @@ @content = @repository.cat(@path, @rev) (show_error_not_found; return) unless @content - if 'raw' == params[:format] || - (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || - ! is_entry_text_data?(@content, @path) + if 'raw' == params[:format] # Force the download send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } send_type = Redmine::MimeType.of(@path) send_opt[:type] = send_type.to_s if send_type send_data @content, send_opt else + @display_raw = ((@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || !is_entry_text_data?(@content, @path)) # Prevent empty lines when displaying a file with Windows style eol # TODO: UTF-16 # Is this needs? AttachmentsController reads file simply.