From c87f36d20b260ac6fcefb3d0ccd9c0f82e5cd295 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 26 Dec 2012 14:00:10 +0000 Subject: [PATCH] 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 --- app/controllers/attachments_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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