Closed Bug 443851 Opened 16 years ago Closed 15 years ago

All parts of a mailto: URI's query string except body should be mime-decoded

Categories

(MailNews Core :: Composition, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: philor, Assigned: mkmelin)

Details

Attachments

(1 file)

Currently, we try to be smart about mime-decoding in nsMailtoUrl::ParseMailtoUrl, only decoding those things (to/cc/bcc/subject) that can usefully be mime-encoded, and not decoding things like newsgroups or newshost that we expect to only be ASCII. Being smart only works if everyone else is smart, though, and there's no reason not to expect someone to create mailto URIs with pointless mime-encoding like =?UTF-8?Q?news.mozilla.org?=. RFC 2368 says that all header values other than body may be mime-encoded; it doesn't say that pointless mime-encoding may not be used.
Product: Core → MailNews Core
Assignee: nobody → mkmelin+mozilla
Target Milestone: --- → Thunderbird 3.0b3
Attached patch proposed fixSplinter Review
Allows all headers except body come in mime-encoded.

The small nsMsgCompUtils change is not strictly this bug, but since I checked it anyway... made Followup-To get encoded the same way as the Newsgroups header.
Attachment #366372 - Flags: superreview?(bugzilla)
Attachment #366372 - Flags: review?(bugzilla)
Status: NEW → ASSIGNED
Comment on attachment 366372 [details] [diff] [review]
proposed fix

>   if (!escapedNewsgroupPart.IsEmpty())
>+  {
>     MsgUnescapeString(escapedNewsgroupPart, 0, m_newsgroupPart);
>+    if (mimeConverter)
>+    {
>+      if (NS_SUCCEEDED(mimeConverter->DecodeMimeHeaderToCharPtr(
>+                         m_newsgroupPart.get(), "UTF-8", PR_FALSE, PR_TRUE,
>+                         &decodedString))
>+          && decodedString)

nit: This is going to make the function slightly inconsistent in itself, but please put the && on the end of the previous line. There again as its only 4 instances without the patch, maybe you could fix them up as well.

>+    organization: "",
>+    replyto: "Ãke <ake@example.org>",

I've a feeling this may break under some circumstances (possibly windows). Could you encode it in \u format like some of the address book tests are?

r/sr=Standard8 with those fixed.
Attachment #366372 - Flags: superreview?(bugzilla)
Attachment #366372 - Flags: superreview+
Attachment #366372 - Flags: review?(bugzilla)
Attachment #366372 - Flags: review+
The \u format didn't work out. Let's hope it works as is on all platforms.

changeset:   2253:ab06268403cb
http://hg.mozilla.org/comm-central/rev/ab06268403cb

->FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: