From c87f36d20b260ac6fcefb3d0ccd9c0f82e5cd295 2012-12-26 14:00:10 From: Jean-Philippe Lang Date: 2012-12-26 14:00:10 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 --- diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 53e0fd6..337a25e 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