diff options
author | John Resig <jeresig@gmail.com> | 2011-05-02 13:14:13 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2011-05-02 13:14:13 -0400 |
commit | 86aa764f0b7b659fbd8eec9333d22c3a79bdfcd5 (patch) | |
tree | 8aa650ad330250e7cb6a7bd2176da14188626d63 /src/core.js | |
parent | f1392d82089323ec9ef97b33909b960cc16c25b6 (diff) | |
download | jquery-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.js | 5 |
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 ); } |