Created
November 15, 2015 13:35
-
-
Save mi-yo/ee50689c508962d9229a to your computer and use it in GitHub Desktop.
Inline image does not work with multibyte filename and plus sign. https://www.redmine.org/issues/10189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- app/models/attachment.rb.org Sun Jul 6 21:44:07 2014 | |
+++ app/models/attachment.rb Sun Nov 15 22:22:52 2015 | |
@@ -255,7 +255,7 @@ | |
def self.latest_attach(attachments, filename) | |
attachments.sort_by(&:created_on).reverse.detect { | |
- |att| att.filename.downcase == filename.downcase | |
+ |att| att.filename.downcase == CGI.unescape(filename.downcase.gsub(/\+/,'%2B')) | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment