Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixes #11402. domManip now also removes the closing part of HTML comm…
…ents or CDATA surrounding executed scripts. Unit tests added.
- Loading branch information
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -29,7 +29,7 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca | ||
// checked="checked" or checked | ||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, | ||
rscriptType = /\/(java|ecma)script/i, | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, | ||
This comment has been minimized.
This comment has been minimized.
gnarf
Member
|
||
wrapMap = { | ||
option: [ 1, "<select multiple='multiple'>", "</select>" ], | ||
legend: [ 1, "<fieldset>", "</fieldset>" ], | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,10 @@ | ||
<script> | ||
<!-- | ||
ok( true, "script within html comments executed" ); | ||
This comment has been minimized.
dmethvin
Member
|
||
--> | ||
</script> | ||
<script> | ||
<![CDATA[ | ||
ok( true, "script within CDATA executed" ); | ||
]]> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I don't think any of the
-
need escapng here:/^\s*<!(?:\[CDATA\[|--)|[\]-]{2}>\s*$/g
The first two have no special meaning outside of
[]
and the third one, so long as the hyphen is the first or last character inside of a[]
it doesn't need to be escaped either.