diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index f493177ec..f47da554e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -207,6 +207,7 @@ class AttachmentsController < ApplicationController @attachment = Attachment.find(params[:id]) # Show 404 if the filename in the url is wrong raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename + @project = @attachment.project rescue ActiveRecord::RecordNotFound render_404