Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8951 (closed defect: duplicate)

Opened 1 year ago

Last modified 1 year ago

Wrong String.unescapeHTML() redefinition for WebKit and IE.

Reported by: Mons Assigned to: sam
Priority: normal Milestone: 1.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

prototype-1.5.1.1: line 406:

  unescapeHTML: function() {
    return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
  }

but should be

  unescapeHTML: function() {
    return this.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
  }

Compare the results of

  var string = '<';
  alert(string.escapeHTML().escapeHTML().unescapeHTML());
  alert(string.escapeHTML());

in Firefox and IE and see the difference

Change History

08/18/07 16:04:09 changed by mislav

  • status changed from new to closed.
  • resolution set to duplicate.

see #8851