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

This commit is contained in:
John Resig 2011-05-02 13:31:23 -04:00
parent 6c449fd5df
commit ca338dc749

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 ];