Defect #18977
closedUTF-8 encoded subject extracted from email
0%
Description
When issue is created from email and email subject consist of multiple lines encoded in base64 only the first line of the subject is shown in 'Issues'.
It happens because of collapse_adjacent_encodings function.
I don't know Ruby so I can not explain exactly what is wrong with the code, but I do know that 2 lines like this
=?UTF-8?B?0J/RgNC+0YjRgyDRgNCw0LfQvtCx0YDQsNGC0YzRgdGPINC4IA==?=
=?UTF-8?B?0L/RgNC40L3Rj9GC0Ywg0YHRgNC+0YfQvdGL0LUg0LzQtdGA0YssINCyIA==?=
can NOT be joined together as commentary to the function says.
Cause if you try to decode from base64 concatenation of this strings the result will be decoded first string, not the concatenation of decoded first and second strings (decode(str1+str2)=decode(str1) and decode(str1+str2)!=decode(str1)+decode(str2) as you would assume). I believe it's because the base64 decoding function ignores everything after '=' symbol. ('=' or '==' in base64 strings are added when last octet decodes to 2 or 1 bytes correspondingly)
Environment:
Redmine version 2.6.0.stable
Ruby version 2.0.0-p598 (2014-11-13) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2
Related issues
Updated by Toshi MARUYAMA almost 10 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Duplicate of #16859.
Updated by Toshi MARUYAMA almost 10 years ago
- Is duplicate of Defect #16859: rdm-mailhandler: subject corruption added