diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-26 14:00:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-26 14:00:10 +0000 |
commit | c87f36d20b260ac6fcefb3d0ccd9c0f82e5cd295 (patch) | |
tree | c0ec1fae8f72e748b16e6047a921f9983665988b /app/controllers/attachments_controller.rb | |
parent | 6be315c1ff8e8fda68083d7ef192e86dabff5228 (diff) | |
download | redmine-c87f36d20b260ac6fcefb3d0ccd9c0f82e5cd295.tar.gz redmine-c87f36d20b260ac6fcefb3d0ccd9c0f82e5cd295.zip |
Log an error when trying to send an attachment that cannot be read.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11084 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r-- | app/controllers/attachments_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 53e0fd6d4..337a25e6e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -128,7 +128,12 @@ private # Checks that the file exists and is readable def file_readable - @attachment.readable? ? true : render_404 + if @attachment.readable? + true + else + logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable." + render_404 + end end def read_authorize |