From 2e91b665b88a0ca0cff190b16a9dc65b551a75a2 Mon Sep 17 00:00:00 2001 From: jamesprior Date: Mon, 27 Oct 2014 12:26:13 -0400 Subject: [PATCH] Do not use params for attachment search If a request comes in for document.pdf?utm_source=email strip out the get params and only search attachments for "document.pdf", not "document.pdf?utm_source=email" --- app/controllers/cms/content_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/cms/content_controller.rb b/app/controllers/cms/content_controller.rb index 58bed6dcb..5cfbbe9a8 100644 --- a/app/controllers/cms/content_controller.rb +++ b/app/controllers/cms/content_controller.rb @@ -150,7 +150,7 @@ def is_file? def try_to_stream_file if is_file? - @attachment = Attachment.find_live_by_file_path(request.fullpath) + @attachment = Attachment.find_live_by_file_path(request.fullpath.split('?').first) send_attachment(@attachment) end