Ticket #1086 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Repeated javascript insertion

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:
Cc:

Description

When there is some javascript code in onclick event, then xinha (or maybe gethtml plugin?) adds some frames code. Unfortunately it does not check if this code exists, so it ends like this:

<a href="#" onclick="if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}if(window.top && window.top.Xinha){return false}$('#wiecej16').toggle('slow');return false;">

Tested in Firefox for now.

Change History

Changed 6 years ago by wymsy

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

The problem was that FF converts the entized '&amp;'s inserted by inwardHtml back to just '&', so the regexps in outwardHtml fail to find a match. Fixed the regexps in changeset:908.

Changed 6 years ago by ray

  • status changed from closed to reopened
  • resolution deleted

The problem is not in inwardHTML but in transformInnerHTML, as ampersands in attributes should generally be entized. Gecko innerHTML is faulty there

Changed 6 years ago by wymsy

In theory you are right, and un-commenting line 79 in transformInnerHtml would be another way to fix this bug. However, that causes problems with all other entized characters in attributes, because regexp c[7] can't tell the difference between an '&' used in an entity and one used standalone. So '&nbsp;' becomes '&amp;nbsp;', for example. That is why line 79 was commented out.

[908] fixes this specific problem, but admittedly it is not elegant. If there is a better way, that's fine with me.

Changed 6 years ago by wymsy

Okay, you got me thinking about that regexp 07 in transformInnerHtml. I changed it to only find standalone &'s, and backed out the change from [908]. This still fixes this ticket, and it also addresses your point about entizing &'s in attributes.

Changed 6 years ago by wymsy

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

Changed 6 years ago by wymsy

Note: See TracTickets for help on using tickets.