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
This commit is contained in:
Jean-Philippe Lang
2009-02-21 16:04:51 +00:00
parent 79c074dbe5
commit 1c5a2ddfb0
3 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -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