Port |Bug 1385172 - Replace nsEscapeHTML{,2}() with new nsAppendEscapedHTML() function| to mailnews

RESOLVED FIXED in Thunderbird 57.0

Status

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jorgk, Assigned: jorgk)

Tracking

unspecified
Thunderbird 57.0

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Assignee

Description

2 years ago
We have
mailnews/base/util/nsMsgUtils.h
#define MsgEscapeHTML(str) nsEscapeHTML(str)
#define MsgEscapeHTML2(buffer, len) nsEscapeHTML2(buffer, len)
and use MsgEscapeHTML quite a bit.
Assignee

Comment 1

2 years ago
Assignee

Updated

2 years ago
Attachment #8899762 - Flags: review?(acelists)

Comment 2

2 years ago
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/80e43346d487
Port bug 1385172 to mailnews: Replace nsEscapeHTML{,2}() with new nsAppendEscapedHTML() function. rs=bustage-fix
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Assignee

Updated

2 years ago
Assignee: nobody → jorgk
Target Milestone: --- → Thunderbird 57.0
Assignee

Comment 3

2 years ago
Comment on attachment 8899762 [details] [diff] [review]
1392529-nsEscapeHTML.patch

Review of attachment 8899762 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/mime/src/mimeebod.cpp
@@ -396,4 @@
>            goto FAIL;
>          }
>          PL_strcpy(body, pre);
> -        PL_strcat(body, s2);

Note that s2 leaked :-(
Assignee

Comment 4

2 years ago
Follow-up as suggested by Eric Rahm in bug 1385172 comment #15.

Comment 5

2 years ago
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/6136a4dd0f4d
Follow-up: use ToNewCString() instead of strdup(). r=me DONTBUILD

Comment 6

2 years ago
Comment on attachment 8899762 [details] [diff] [review]
1392529-nsEscapeHTML.patch

Review of attachment 8899762 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.

::: mailnews/mime/emitters/nsMimeBaseEmitter.cpp
@@ +878,1 @@
>        mHTMLHeaders.Append(escapedName);

Would it work to directly append to mHTMLHeaders?
nsAppendEscapedHTML(name, mHTMLHeaders);
Attachment #8899762 - Flags: review?(acelists) → review+

Updated

2 years ago
Attachment #8899935 - Flags: review+
Assignee

Comment 7

2 years ago
(In reply to :aceman from comment #6)
> Would it work to directly append to mHTMLHeaders?
> nsAppendEscapedHTML(name, mHTMLHeaders);
Yep. I'll do another follow-up.

Comment 9

2 years ago
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/be1c2f371496
Follow-up (take 2): Simplification. r=aceman DONTBUILD
You need to log in before you can comment on or make changes to this bug.