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:
rjgotten 2010-10-17 08:30:05 -07:00
parent 497fc9849e
commit df7dfc2404

View file

@ -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] );
}