]> source.dussan.org Git - redmine.git/commitdiff
Log an error when trying to send an attachment that cannot be read.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 26 Dec 2012 14:00:10 +0000 (14:00 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 26 Dec 2012 14:00:10 +0000 (14:00 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11084 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/attachments_controller.rb

index 53e0fd6d46f47805752f8bbd28c3739312833546..337a25e6e5b5cdfa6e322be2531b4ee276cc7a00 100644 (file)
@@ -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