mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Skip id regex check when large html strings are passed to the jQuery constructor (#7990).
This commit is contained in:
@@ -96,7 +96,12 @@ jQuery.fn = jQuery.prototype = {
|
||||
// Handle HTML strings
|
||||
if ( typeof selector === "string" ) {
|
||||
// Are we dealing with HTML string or an ID?
|
||||
match = quickExpr.exec( selector );
|
||||
if ( selector.length > 1024 ) {
|
||||
// Assume very large strings are HTML and skip the regex check
|
||||
match = [ null, selector, null ];
|
||||
} else {
|
||||
match = quickExpr.exec( selector );
|
||||
}
|
||||
|
||||
// Verify a match, and that no context was specified for #id
|
||||
if ( match && (match[1] || !context) ) {
|
||||
|
||||
Reference in New Issue
Block a user