Ticket #4387 (closed Bug: fixed)
Right clicking in Kama skin can lead to a javascript error
| Reported by: | fringley | Owned by: | tobiasz.cudnik |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.1 |
| Component: | General | Version: | 3.0 |
| Keywords: | Confirmed Review+ | Cc: |
Description
This in turn would then stop any toolbar buttons working that opened a dialog window.
Bug was chased down to iterating over an array in the Kama skin javascript file (patch attached)
Attachments
Change History
Changed 4 years ago by fringley
- Attachment ticket_4387.patch added
comment:1 Changed 4 years ago by tobiasz.cudnik
- Status changed from new to assigned
- Owner set to tobiasz.cudnik
comment:2 Changed 4 years ago by tobiasz.cudnik
- Keywords Confirmed added
What version of safari is affected by this issue ?
It looks strange as it's just a "for in" loop over array. I can't reproduce it on newest safari 4 and safari 3.2.2.
Anyway, thank you for the patch.
comment:4 Changed 4 years ago by fringley
I had the problem in 4.0.3.
I was a little puzzled by the problem as well, but generally it is bad practice to use for..in loops with arrays as it is not reliable if anything changes the array prototype.
comment:5 Changed 4 years ago by tobiasz.cudnik
- Keywords Confirmed Review? added; Pending removed
Changed array prototype explains the issue.
Attaching prepared patch.
comment:6 Changed 4 years ago by fringley
The patch I made to our version is from the 3.0 release (which if different to the one in Trunk) which seemed to use the same iteration technique in several places. You may want to double-check anywhere else that uses for..in.
comment:8 Changed 4 years ago by tobiasz.cudnik
You're right, there were 3 more.
After deeper checking, there is quite a bunch of for..in loops inside core code. Most of it iterates over objects (i think nobody extends Object.prototype those days ?), but some of them like editor.js L189 are same cases like this one. Doesn't it create any issue for you ?
comment:9 Changed 4 years ago by tobiasz.cudnik
- Status changed from assigned to closed
- Resolution set to fixed
Fixed with [4211].
comment:10 Changed 4 years ago by fringley
As yet, I've not had any more javascript errors occur, but it is possible that in my use I have not exercised those code paths.

Patch