Check for #8984 wasn't strong enough, enhanced.

1.7/enhancement_8685
John Resig 2011-05-02 13:31:23 -04:00
parent 6c449fd5df
commit ca338dc749
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ jQuery.fn = jQuery.prototype = {
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
if ( selector.charAt(0) === "<" || selector.charAt( selector.length - 1 ) === ">" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];