From 99be187d544e1a4e3f979288e66490c4a5594550 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 9 Mar 2016 11:30:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=A2=84=E8=A7=88=E7=9A=84=E6=96=87=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=9B=B4=E6=8E=A5=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index f7845d6f1..e49c5a696 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -431,7 +431,10 @@ update def entry entry_and_raw(false) - render :layout => 'base_projects' + @content = @repository.cat(@path, @rev) + if is_entry_text_data?(@content, @path) + render :layout => 'base_projects' + end end def entry_and_raw(is_raw) @@ -443,9 +446,7 @@ update @content = @repository.cat(@path, @rev) (show_error_not_found; return) unless @content - if is_raw || - (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || - ! is_entry_text_data?(@content, @path) + if is_raw || (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || !is_entry_text_data?(@content, @path) # Force the download send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } send_type = Redmine::MimeType.of(@path)