mirror of
https://github.com/jquery/jquery.git
synced 2026-02-07 03:14:58 -05:00
Adjust jQuery('html') detection to only match when html starts with '<' (counting space characters). Fixes #11290
This commit is contained in:
@@ -40,9 +40,8 @@ var
|
||||
trimRight = /\s+$/,
|
||||
|
||||
// A simple way to check for HTML strings
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
// Ignore html if within quotes "" '' or brackets/parens [] ()
|
||||
rhtmlString = /^(?:[^#<\\]*(<[\w\W]+>)(?![^\[]*\])(?![^\(]*\))(?![^']*')(?![^"]*")[^>]*$)/,
|
||||
// If starts-with '<'
|
||||
rhtmlString = /^\s*(<[\w\W]+>)[^>]*$/,
|
||||
|
||||
// Match a standalone tag
|
||||
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
|
||||
Reference in New Issue
Block a user