aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2011-05-02 13:14:13 -0400
committerJohn Resig <jeresig@gmail.com>2011-05-02 13:14:13 -0400
commit86aa764f0b7b659fbd8eec9333d22c3a79bdfcd5 (patch)
tree8aa650ad330250e7cb6a7bd2176da14188626d63 /src/core.js
parentf1392d82089323ec9ef97b33909b960cc16c25b6 (diff)
downloadjquery-86aa764f0b7b659fbd8eec9333d22c3a79bdfcd5.tar.gz
jquery-86aa764f0b7b659fbd8eec9333d22c3a79bdfcd5.zip
Change check for skipping the initial quickExpr RegExp check. Fixes #8984.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js
index 8d812e384..6ab06e15b 100644
--- a/src/core.js
+++ b/src/core.js
@@ -96,9 +96,10 @@ jQuery.fn = jQuery.prototype = {
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
- if ( selector.length > 1024 ) {
- // Assume very large strings are HTML and skip the regex check
+ if ( selector.charAt(0) === "<" || selector.charAt( selector.length - 1 ) === ">" ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
+
} else {
match = quickExpr.exec( selector );
}