Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#9314 closed defect (fixed)

[PATCH[[CCLA] IE Specific: Editor throws errors when special strings are pasted in from notepad

Reported by: Jared Jurkiewicz Owned by: liucougar
Priority: high Milestone: 1.4
Component: Editor Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

IE Specific: Editor throws errors when special strings are pasted in from notepad

This was reported by a co-worker who was doing some testing. He input a string:

`~!@#$%&*()-_=+[{]}\|;:'",<.>/?

via cut/paste

and the Rich Text editor threw errors. I identified the problem:

The problem is in a code section specific to IE. In function:

dijit._editor.getNodeHtml=function

Has a section that uses node.outerHTML (An IE specific attr).

When that text is pasted in, the paste code of IE/Windows (out of our control), creates it as an <a href="mailto:"></a> style tag.

This gets captured in the outerHTML and run through some regular expressions.

The problem is because it's a crazy-looking tag (bad), one of the 'keys' identified ends up being the mailto: junk. This is then looked up on the node (which naturally returns undefined/null).

The code then does: attrarray.push([key, val.toString()]);

That val.toString() is called on null, which throws the error in question.

This requires both a fix to verify that all values are defined before calling toString() on it, and a fix to the regular expression so the chance of getting weird 'keys' is less.

Patches forcoming.

Attachments (2)

ie_cutpaste_oddstring_1.2.3.patch (701 bytes) - added by Jared Jurkiewicz 11 years ago.
Patch for 1.2.3
ie_cutpaste_oddstring_1.3.1.patch (701 bytes) - added by Jared Jurkiewicz 11 years ago.
Patch for 1.3.1 (It's the same as 1.2.3).

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Jared Jurkiewicz

Patch for 1.2.3

Changed 11 years ago by Jared Jurkiewicz

Patch for 1.3.1 (It's the same as 1.2.3).

comment:1 Changed 11 years ago by Jared Jurkiewicz

I'm going to commit this. I don't want a patch sitting too long that's trivial.

comment:2 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [17562]) Minor fix to IE checking. fixes #9314

comment:3 Changed 11 years ago by Adam Peller

Milestone: tbd1.4

may also belong in the 1.3 branch, in case there's ever another 1.3 build

Note: See TracTickets for help on using tickets.