#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:
`[email protected]#$%&*()-_=+[{]}\|;:'",<.>/?
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)
Change History (5)
Changed 13 years ago by
Attachment: | ie_cutpaste_oddstring_1.2.3.patch added |
---|
Changed 13 years ago by
Attachment: | ie_cutpaste_oddstring_1.3.1.patch added |
---|
Patch for 1.3.1 (It's the same as 1.2.3).
comment:1 Changed 13 years ago by
I'm going to commit this. I don't want a patch sitting too long that's trivial.
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 13 years ago by
Milestone: | tbd → 1.4 |
---|
may also belong in the 1.3 branch, in case there's ever another 1.3 build
Patch for 1.2.3