Check against the type attribute of script elements retrieved through getElementsByTagName() so that only those elements of type "text/javascript" are handled by 'clean'.
Fixes #6180: jQuery.clean should not touch script tags that are not of type text/javascript
This commit is contained in:
parent
497fc9849e
commit
df7dfc2404
|
@ -531,7 +531,9 @@ jQuery.extend({
|
|||
|
||||
} else {
|
||||
if ( ret[i].nodeType === 1 ) {
|
||||
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
|
||||
var jsTags = jQuery.makeArray( ret[i].getElementsByTagName( "script" )),
|
||||
jsTags = jQuery.grep(jsTags, function(n, i) { return ( !n.type || n.type.toLowerCase() === "text/javascript" ) });
|
||||
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ));
|
||||
}
|
||||
fragment.appendChild( ret[i] );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue