Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#5501 closed defect (fixed)

ComboBox double-escaping HTML entities in inlined data

Reported by: guest Owned by: bill
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

Items containing HTML entities in a ComboBox? are displayed incorrectly. The ampersand is always converted to "&", even if it is already part of an escape sequence. Example:

<option>Foo & Bar</option> becomes "Foo &amp; Bar"

and

<option>Foo &amp; Bar</option> becomes "Foo &amp;amp; Bar"

Both IE7 and FF2 did this. The innerHTML attribute seems to be the culprit. I changed line 542 of ComboBox?.js from

return { value: node.getAttribute("value"), name: String(node.innerHTML) };

to

return { value: node.getAttribute("value"), name: String(node.innerText||node.textContent) };

and it works correctly. (Is a CLA required for a 1-line fix?)

Change History (4)

comment:1 Changed 12 years ago by bill

Milestone: 1.1
Owner: set to bill
Status: newassigned
Summary: ComboBox double-escaping HTML entitiesComboBox double-escaping HTML entities in inlined data

No CLA required for one line fixes; I'll put this into 1.1. (The code has changed but looks like the same problem is still there.)

comment:2 Changed 12 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [11947]) Fixes #5501: ComboBox? double-escaping HTML entities in inlined data

comment:3 Changed 12 years ago by bill

Another fix in [11949].

comment:4 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.