From 1c5a2ddfb07cd4993fa9f28542df51a399e29a6c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 21 Feb 2009 16:04:51 +0000 Subject: Limit the size of repository files displayed inline too. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2505 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/repositories_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e2cdd17b8..3e8ac3e3d 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -117,8 +117,8 @@ class RepositoriesController < ApplicationController @content = @repository.cat(@path, @rev) show_error_not_found and return unless @content - if 'raw' == params[:format] || @content.is_binary_data? - # Force the download if it's a binary file + if 'raw' == params[:format] || @content.is_binary_data? || (@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte) + # Force the download send_data @content, :filename => @path.split('/').last else # Prevent empty lines when displaying a file with Windows style eol -- cgit v1.2.3