mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Check nodeType of elements passed to selector-native's find. Fixes #13577.
This commit is contained in:
parent
6d04ebfafb
commit
8d3c0506c8
@ -62,12 +62,22 @@ var selector_hasDuplicate,
|
||||
|
||||
jQuery.extend({
|
||||
find: function( selector, context, results, seed ) {
|
||||
var elem,
|
||||
var elem, nodeType,
|
||||
i = 0;
|
||||
|
||||
results = results || [];
|
||||
context = context || document;
|
||||
|
||||
// Same basic safeguard as Sizzle
|
||||
if ( !selector || typeof selector !== "string" ) {
|
||||
return results;
|
||||
}
|
||||
|
||||
// Early return if context is not an element or document
|
||||
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if ( seed ) {
|
||||
while ( (elem = seed[i++]) ) {
|
||||
if ( jQuery.find.matchesSelector(elem, selector) ) {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b8789b87f1ecb00f0de82b2a13a3474dabdab406
|
||||
Subproject commit 853c272575c692b39d4f9ea10f3f808696d1a574
|
Loading…
Reference in New Issue
Block a user