Opened 10 years ago
Closed 9 years ago
#14844 closed bug (duplicate)
buildFragment process "script" element error
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.12/2.2 |
Component: | core | Version: | 1.11.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
i use jquery to insert an html, which contains "script" element.
the javascript code in the element is replaced, cause syntax error.
$.parseHTML('<script>if("100<b.length"){String(u).replace(/>/g,">");}</script>',true);
output:
if("100<b.length"){String(u).replace(></b>/g,">");}
the RegExp was massed
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 9 years ago by
Component: | unfiled → core |
---|---|
Milestone: | None → 1.12/2.2 |
Priority: | undecided → low |
Status: | new → open |
Regex. Ugh.
comment:3 Changed 9 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
Note: See
TracTickets for help on using
tickets.
var a="%3Cscript%3Evar%20u%3D%22%3Ch1%3Eabcde%3C%2Fh1%3E%22%3Bif(%22100%3Cu.length%22)%7Bu.replace(%2F%3E%2Fg%2C%22%26gt%3B%22)%3B%7D%3C%2Fscript%3E"; a=decodeURIComponent(a); alert(a); alert(decodeURIComponent('%3Cscript%3E')+$(a).html()+decodeURIComponent("%3C%2Fscript%3E"));
these code should alert 2 same code, but not