mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 21:15:01 -05:00
Core: Throw an error on $("#") rather than returning 0-length collection
Closes gh-1682 Thanks @goob for the issue report!
This commit is contained in:
@@ -11,7 +11,8 @@ var rootjQuery,
|
||||
// A simple way to check for HTML strings
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
// Strict HTML recognition (#11290: must start with <)
|
||||
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
||||
// Shortcut simple #id case for speed
|
||||
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
|
||||
|
||||
init = jQuery.fn.init = function( selector, context ) {
|
||||
var match, elem;
|
||||
|
||||
Reference in New Issue
Block a user