Ticket #5501 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

ComboBox double-escaping HTML entities in inlined data

Reported by: guest Owned by: bill
Priority: normal Milestone: 1.1
Component: Dijit Version: 1.0
Severity: normal Keywords:
Cc:

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

Changed 8 months ago by bill

  • owner set to bill
  • status changed from new to assigned
  • summary changed from ComboBox double-escaping HTML entities to ComboBox double-escaping HTML entities in inlined data
  • milestone set to 1.1

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.)

Changed 8 months ago by bill

  • status changed from assigned to closed
  • resolution set to fixed

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

Changed 8 months ago by bill

Another fix in [11949].

Note: See TracTickets for help on using tickets.