Commit df7dfc24 authored by rjgotten's avatar rjgotten

Check against the type attribute of script elements retrieved through...

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
parent 497fc984
...@@ -531,7 +531,9 @@ jQuery.extend({ ...@@ -531,7 +531,9 @@ jQuery.extend({
} else { } else {
if ( ret[i].nodeType === 1 ) { 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] ); fragment.appendChild( ret[i] );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment