mirror of
https://github.com/jquery/jquery.git
synced 2026-02-11 12:05:01 -05:00
Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
This commit is contained in:
@@ -16,8 +16,8 @@ var jQuery = function( selector, context ) {
|
||||
rootjQuery,
|
||||
|
||||
// A simple way to check for HTML strings or ID strings
|
||||
// (both of which we optimize for)
|
||||
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
||||
|
||||
// Check if a string has a non-whitespace character in it
|
||||
rnotwhite = /\S/,
|
||||
|
||||
Reference in New Issue
Block a user