diff --git a/build/jslint-check.js b/build/jslint-check.js
index 72d6701876..567f99a952 100644
--- a/build/jslint-check.js
+++ b/build/jslint-check.js
@@ -1,5 +1,5 @@
var JSLINT = require("./lib/jslint").JSLINT,
- print = require("sys").print,
+ print = console.log,
src = require("fs").readFileSync("dist/jquery.js", "utf8");
JSLINT(src, { evil: true, forin: true, maxerr: 100 });
@@ -21,7 +21,7 @@ var e = JSLINT.errors, found = 0, w;
for ( var i = 0; i < e.length; i++ ) {
w = e[i];
- if ( !ok[ w.reason ] ) {
+ if ( w && !ok[ w.reason ] ) {
found++;
print( "\n" + w.evidence + "\n" );
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
diff --git a/build/post-compile.js b/build/post-compile.js
index 4bcafe8145..7c67d8746e 100644
--- a/build/post-compile.js
+++ b/build/post-compile.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-var print = require("sys").print,
+var print = console.log,
src = require("fs").readFileSync(process.argv[2], "utf8");
// Previously done in sed but reimplemented here due to portability issues
diff --git a/component.json b/component.json
index 363d807790..bf226a440d 100755
--- a/component.json
+++ b/component.json
@@ -1,6 +1,6 @@
{
"name" : "jquery",
- "version" : "1.5.2",
+ "version" : "1.5.3-sec",
"main" : "./jquery.js",
"dependencies": {
}
diff --git a/jquery.js b/jquery.js
index ae0234d2bb..5d0e680998 100755
--- a/jquery.js
+++ b/jquery.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.5.2
+ * jQuery JavaScript Library v1.5.3-sec
* http://jquery.com/
*
* Copyright 2011, John Resig
@@ -11,7 +11,7 @@
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Thu Mar 31 15:28:23 2011 -0400
+ * Date: Thu Feb 15 18:40:42 2024 -0600
*/
(function( window, undefined ) {
@@ -35,8 +35,9 @@ 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 to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ quickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
@@ -196,7 +197,7 @@ jQuery.fn = jQuery.prototype = {
selector: "",
// The current version of jQuery being used
- jquery: "1.5.2",
+ jquery: "1.5.3-sec",
// The default length of a jQuery object is 0
length: 0,
@@ -340,8 +341,9 @@ jQuery.extend = jQuery.fn.extend = function() {
src = target[ name ];
copy = options[ name ];
+ // Prevent Object.prototype pollution
// Prevent never-ending loop
- if ( target === copy ) {
+ if ( name === "__proto__" || target === copy ) {
continue;
}
@@ -5035,7 +5037,6 @@ function winnow( elements, qualifier, keep ) {
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rtagName = /<([\w:]+)/,
rtbody = /" ],
legend: [ 1, "" ],
thead: [ 1, "" ],
tr: [ 2, "" ],
@@ -5053,7 +5053,6 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
_default: [ 0, "", "" ]
};
-wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
@@ -5236,8 +5235,6 @@ jQuery.fn.extend({
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
- value = value.replace(rxhtmlTag, "<$1>$2>");
-
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
@@ -5607,8 +5604,6 @@ jQuery.extend({
elem = context.createTextNode( elem );
} else if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, "<$1>$2>");
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
@@ -6111,7 +6106,7 @@ var r20 = /%20/g,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rquery = /\?/,
- rscript = /