Defect #32914

Rails 6: remove #filename_for_content_disposition for MS browsers

Added by Pavel Rosický over 1 year ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Rails support
Target version:-
Resolution:Fixed Affected version:

Description

relates to #32913

this prevents double escaping, fixes

WikiControllerTest#test_show_filename_should_be_uri_encoded_for_ms_browsers [/redmine/test/functional/wiki_controller_test.rb:1146]:
--- expected
+++ actual
@@ -1 +1 @@
-"attachment; filename=\"Этика_менеджмента.pdf\"" 
+"attachment; filename=\"%3F%3F%3F%3F%3F_%3F%3F%3F%3F%3F%3F%3F%3F%3F%3F%3F.pdf\"; filename*=UTF-8''%D0%AD%D1%82%D0%B8%D0%BA%D0%B0_%D0%BC%D0%B5%D0%BD%D0%B5%D0%B4%D0%B6%D0%BC%D0%B5%D0%BD%D1%82%D0%B0.pdf" 

Rails 6 escapes filenames per RFC 2231 for all browsers https://github.com/rails/rails/commit/890485cfce4c361c03a41ec23b0ba187007818cc

#filename_for_content_disposition just returns the original name for compatibility reasons, but if we don't care, we can just remove the method

msescape.patch Magnifier (2.35 KB) Pavel Rosický, 2020-01-29 02:00


Related issues

Related to Redmine - Feature #29914: Migrate to Rails 6.1 New

Associated revisions

Revision 20892
Added by Go MAEDA 4 months ago

Remove #filename_for_content_disposition for MS browsers (#29914, #32914).

Patch by Pavel Rosický.

History

#1 Updated by Marius BALTEANU over 1 year ago

#2 Updated by Go MAEDA over 1 year ago

  • Category set to Rails support

#3 Updated by Marius BALTEANU 4 months ago

  • Tracker changed from Patch to Defect

#4 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch as a part of #29914.

Also available in: Atom PDF