Defect #13284

Should not try to strip HTML tags from text/plain MIME part

Added by Alex Shulgin over 4 years ago. Updated over 4 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-
Resolution: Affected version:

Description

Redmine currently tries to strip HTML tags from the message part even if it's not an HTML part. This results in blocks of text like the following being stripped altogether (after the first angle bracket):

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
...

Attached patch fixes this.

b9a0aa7ee24364a2fe025f9482fcff969b2a133d.patch Magnifier (1010 Bytes) Alex Shulgin, 2013-02-25 22:37

History

#1 Updated by Alex Shulgin over 4 years ago

Alex Shulgin wrote:

Redmine currently tries to strip HTML tags from the message part even if it's not an HTML part. This results in blocks of text like the following being stripped altogether (after the first angle bracket):

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
...

Actually, with the quoted block as above it only removes the first unclosed 'tag': "<1024". However, if there are quote symbols (double or single) anywhere in the line after the unclosed tag, it removes all the content between the start of the unclosed symbol and the last quote symbol.

I'm now wondering if this should be seen as a bug of strip_tags method in Rails. Shouldn't it just ignore invalid markup instead of removing it?

--
Alex

#2 Updated by Etienne Massip over 4 years ago

What's your Redmine version please?

#3 Updated by Alex Shulgin over 4 years ago

Etienne Massip wrote:

What's your Redmine version please?

Mine is 2.2-stable. The code in trunk is identical, so it must be doing the same (dumb) thing.

--
Alex

Also available in: Atom PDF