diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-21 16:04:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-21 16:04:51 +0000 |
commit | 1c5a2ddfb07cd4993fa9f28542df51a399e29a6c (patch) | |
tree | 201ae4a82eb6d67214051952125a8dbd0de76570 /app | |
parent | 79c074dbe59001233947db7a32afe04e11be0fad (diff) | |
download | redmine-1c5a2ddfb07cd4993fa9f28542df51a399e29a6c.tar.gz redmine-1c5a2ddfb07cd4993fa9f28542df51a399e29a6c.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/repositories_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |