Project

General

Profile

Actions

Defect #13284

closed

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

Added by Alex Shulgin over 11 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
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.


Files


Related issues

Related to Redmine - Feature #16962: Better handle html-only emailsClosedJean-Philippe Lang

Actions
Actions #1

Updated by Alex Shulgin over 11 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

Actions #2

Updated by Etienne Massip over 11 years ago

What's your Redmine version please?

Actions #3

Updated by Alex Shulgin over 11 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

Actions #4

Updated by Go MAEDA almost 6 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Fixed by #16962. Redmine 3.1.0 and later don't strip tag-like strings for text parts.

Actions #5

Updated by Go MAEDA almost 6 years ago

Actions

Also available in: Atom PDF