mirror of
https://github.com/jquery/jquery.git
synced 2026-02-07 03:14:58 -05:00
When detecting html in init, ignore html characters within quotes, brackets, and parens as well as escaped characters which are valid in selectors. Fixes #11290.
This commit is contained in:
@@ -41,7 +41,8 @@ var
|
||||
|
||||
// A simple way to check for HTML strings
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
rhtmlString = /^(?:[^#<]*(<[\w\W]+>)[^>]*$)/,
|
||||
// Ignore html if within quotes "" '' or brackets/parens [] ()
|
||||
rhtmlString = /^(?:[^#<\\]*(<[\w\W]+>)(?![^\[]*\])(?![^\(]*\))(?![^']*')(?![^"]*")[^>]*$)/,
|
||||
|
||||
// Match a standalone tag
|
||||
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
|
||||
Reference in New Issue
Block a user