Cannot save attachment if name contains a quote (')

VERIFIED FIXED in M13

Status

MailNews Core
MIME
P3
normal
VERIFIED FIXED
19 years ago
10 years ago

People

(Reporter: Jean-Francois Ducarroz, Assigned: Scott MacGregor)

Tracking

Trunk
PowerPC
Mac System 8.5

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
If I receive a message with a file attached to it and the attachment name contains some special characteres like a
quote, you cannot save it when you clik on the attachment icon. We get the following JS error:

JavaScript Error: illegal character
Line text: 'OpenAttachURL('imap%3A//qatest03%40nsmail-2%3A143/fetch%3EUID%3E/INBOX%3E634%3Fpart%3D1.2',
'l'ÈtÈ.txt', 'imap_message://qatest03@nsmail-2/INBOX#634')'

I don't know if this bug if for jefft or for rhp.
(Reporter)

Updated

19 years ago
Summary: Cannot save attachment if name contains an quote (') → Cannot save attachment if name contains a quote (')

Updated

19 years ago
QA Contact: lchiang → pmock

Updated

19 years ago
Status: NEW → ASSIGNED
Target Milestone: M13

Comment 1

19 years ago
Ok guys, what is the "right" fix for this. The problem is that when we have
characters like ' or " in a filename, it breaks the JS syntax. Is there a way
to safeguard the JS to ignore what is in the string, or do we have to escape it
before we pass it into JS?

Just wondering what the right change goes.

- rhp

Comment 2

19 years ago
Hi Naoki,
I need to escape a unicode string. Is there a function that would allow me to
do this?

Also, mscott: I think what we need to do is escape the string in the emitter
and then unescape it in JS. That's what Jeff and I were thinking made sense.

- rhp
(Assignee)

Comment 3

19 years ago
Rich, I have a fix for this in my tree. You can re-assign this to me if you want.

You definetly don't want to escape the string in the mime emitter because then
the attachment won't display correctly! The display name will be escaped which
isn't correct.

In JS you can escape a string by calling escape(string).

I also had to unescape it in messenger.

I'll check it in when the tree opens.

I set up a test case and it works.

Updated

19 years ago
Assignee: rhp → mscott
Status: ASSIGNED → NEW

Comment 4

19 years ago
Over to you Scott!

- rhp
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

19 years ago
Fix checked in.

Comment 6

19 years ago
Linux (2000-03-09-08 M14)
Win32 (2000-03-08-13 M14)
Mac  (2000-03-07-08 M14)mozilla

This problem has been fixed.

Using previous Mac build because 3/8 and 3/9 Mac builds are broken.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.