Skip to content

Commit f400223

Browse files
committed
Merge branch '1.2.7-sec' into 1.3.3-sec
2 parents 13e9cde + 8f1483b commit f400223

File tree

6 files changed

+199
-185
lines changed

6 files changed

+199
-185
lines changed

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "jquery",
3-
"version" : "1.3.2",
3+
"version" : "1.3.3-sec",
44
"main" : "./jquery.js",
55
"dependencies": {
66
}

jquery.js

Lines changed: 157 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*!
2-
* jQuery JavaScript Library v1.3.2
2+
* jQuery JavaScript Library v1.3.3-sec
33
* http://jquery.com/
44
*
55
* Copyright (c) 2009 John Resig
66
* Dual licensed under the MIT and GPL licenses.
77
* http://docs.jquery.com/License
88
*
9-
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10-
* Revision: 6246
9+
* Date:
10+
* Revision:
1111
*/
1212
(function(){
1313

@@ -27,8 +27,10 @@ var
2727
},
2828

2929
// A simple way to check for HTML strings or ID strings
30-
// (both of which we optimize for)
31-
quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
30+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
31+
// Strict HTML recognition (#11290: must start with <)
32+
quickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
33+
3234
// Is it a simple selector
3335
isSimple = /^.[^:#\[\.,]*$/;
3436

@@ -58,11 +60,11 @@ jQuery.fn = jQuery.prototype = {
5860

5961
// HANDLE: $("#id")
6062
else {
61-
var elem = document.getElementById( match[3] );
63+
var elem = document.getElementById( match[2] );
6264

6365
// Handle the case where IE and Opera return items
6466
// by name instead of ID
65-
if ( elem && elem.id != match[3] )
67+
if ( elem && elem.id != match[2] )
6668
return jQuery().find( selector );
6769

6870
// Otherwise, we inject the element directly into the jQuery object
@@ -97,7 +99,7 @@ jQuery.fn = jQuery.prototype = {
9799
selector: "",
98100

99101
// The current version of jQuery being used
100-
jquery: "1.3.2",
102+
jquery: "1.3.3-sec",
101103

102104
// The number of elements contained in the matched element set
103105
size: function() {
@@ -588,8 +590,9 @@ jQuery.extend = jQuery.fn.extend = function() {
588590
for ( var name in options ) {
589591
var src = target[ name ], copy = options[ name ];
590592

593+
// Prevent Object.prototype pollution
591594
// Prevent never-ending loop
592-
if ( target === copy )
595+
if ( name === "__proto__" || target === copy )
593596
continue;
594597

595598
// Recurse if we're merging object values
@@ -870,21 +873,10 @@ jQuery.extend({
870873

871874
// Convert html string into DOM nodes
872875
if ( typeof elem === "string" ) {
873-
// Fix "XHTML"-style tags in all browsers
874-
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
875-
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
876-
all :
877-
front + "></" + tag + ">";
878-
});
879-
880876
// Trim whitespace, otherwise indexOf won't work as expected
881877
var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
882878

883879
var wrap =
884-
// option or optgroup
885-
!tags.indexOf("<opt") &&
886-
[ 1, "<select multiple='multiple'>", "</select>" ] ||
887-
888880
!tags.indexOf("<leg") &&
889881
[ 1, "<fieldset>", "</fieldset>" ] ||
890882

@@ -1266,150 +1258,150 @@ jQuery.each({
12661258
function num(elem, prop) {
12671259
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
12681260
}
1269-
var expando = "jQuery" + now(), uuid = 0, windowData = {};
1270-
1271-
jQuery.extend({
1272-
cache: {},
1273-
1274-
data: function( elem, name, data ) {
1275-
elem = elem == window ?
1276-
windowData :
1277-
elem;
1278-
1279-
var id = elem[ expando ];
1280-
1281-
// Compute a unique ID for the element
1282-
if ( !id )
1283-
id = elem[ expando ] = ++uuid;
1284-
1285-
// Only generate the data cache if we're
1286-
// trying to access or manipulate it
1287-
if ( name && !jQuery.cache[ id ] )
1288-
jQuery.cache[ id ] = {};
1289-
1290-
// Prevent overriding the named cache with undefined values
1291-
if ( data !== undefined )
1292-
jQuery.cache[ id ][ name ] = data;
1293-
1294-
// Return the named cache data, or the ID for the element
1295-
return name ?
1296-
jQuery.cache[ id ][ name ] :
1297-
id;
1298-
},
1299-
1300-
removeData: function( elem, name ) {
1301-
elem = elem == window ?
1302-
windowData :
1303-
elem;
1304-
1305-
var id = elem[ expando ];
1306-
1307-
// If we want to remove a specific section of the element's data
1308-
if ( name ) {
1309-
if ( jQuery.cache[ id ] ) {
1310-
// Remove the section of cache data
1311-
delete jQuery.cache[ id ][ name ];
1312-
1313-
// If we've removed all the data, remove the element's cache
1314-
name = "";
1315-
1316-
for ( name in jQuery.cache[ id ] )
1317-
break;
1318-
1319-
if ( !name )
1320-
jQuery.removeData( elem );
1321-
}
1322-
1323-
// Otherwise, we want to remove all of the element's data
1324-
} else {
1325-
// Clean up the element expando
1326-
try {
1327-
delete elem[ expando ];
1328-
} catch(e){
1329-
// IE has trouble directly removing the expando
1330-
// but it's ok with using removeAttribute
1331-
if ( elem.removeAttribute )
1332-
elem.removeAttribute( expando );
1333-
}
1334-
1335-
// Completely remove the data cache
1336-
delete jQuery.cache[ id ];
1337-
}
1338-
},
1339-
queue: function( elem, type, data ) {
1340-
if ( elem ){
1341-
1342-
type = (type || "fx") + "queue";
1343-
1344-
var q = jQuery.data( elem, type );
1345-
1346-
if ( !q || jQuery.isArray(data) )
1347-
q = jQuery.data( elem, type, jQuery.makeArray(data) );
1348-
else if( data )
1349-
q.push( data );
1350-
1351-
}
1352-
return q;
1353-
},
1354-
1355-
dequeue: function( elem, type ){
1356-
var queue = jQuery.queue( elem, type ),
1357-
fn = queue.shift();
1358-
1359-
if( !type || type === "fx" )
1360-
fn = queue[0];
1361-
1362-
if( fn !== undefined )
1363-
fn.call(elem);
1364-
}
1365-
});
1366-
1367-
jQuery.fn.extend({
1368-
data: function( key, value ){
1369-
var parts = key.split(".");
1370-
parts[1] = parts[1] ? "." + parts[1] : "";
1371-
1372-
if ( value === undefined ) {
1373-
var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1374-
1375-
if ( data === undefined && this.length )
1376-
data = jQuery.data( this[0], key );
1377-
1378-
return data === undefined && parts[1] ?
1379-
this.data( parts[0] ) :
1380-
data;
1381-
} else
1382-
return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
1383-
jQuery.data( this, key, value );
1384-
});
1385-
},
1386-
1387-
removeData: function( key ){
1388-
return this.each(function(){
1389-
jQuery.removeData( this, key );
1390-
});
1391-
},
1392-
queue: function(type, data){
1393-
if ( typeof type !== "string" ) {
1394-
data = type;
1395-
type = "fx";
1396-
}
1397-
1398-
if ( data === undefined )
1399-
return jQuery.queue( this[0], type );
1400-
1401-
return this.each(function(){
1402-
var queue = jQuery.queue( this, type, data );
1403-
1404-
if( type == "fx" && queue.length == 1 )
1405-
queue[0].call(this);
1406-
});
1407-
},
1408-
dequeue: function(type){
1409-
return this.each(function(){
1410-
jQuery.dequeue( this, type );
1411-
});
1412-
}
1261+
var expando = "jQuery" + now(), uuid = 0, windowData = {};
1262+
1263+
jQuery.extend({
1264+
cache: {},
1265+
1266+
data: function( elem, name, data ) {
1267+
elem = elem == window ?
1268+
windowData :
1269+
elem;
1270+
1271+
var id = elem[ expando ];
1272+
1273+
// Compute a unique ID for the element
1274+
if ( !id )
1275+
id = elem[ expando ] = ++uuid;
1276+
1277+
// Only generate the data cache if we're
1278+
// trying to access or manipulate it
1279+
if ( name && !jQuery.cache[ id ] )
1280+
jQuery.cache[ id ] = {};
1281+
1282+
// Prevent overriding the named cache with undefined values
1283+
if ( data !== undefined )
1284+
jQuery.cache[ id ][ name ] = data;
1285+
1286+
// Return the named cache data, or the ID for the element
1287+
return name ?
1288+
jQuery.cache[ id ][ name ] :
1289+
id;
1290+
},
1291+
1292+
removeData: function( elem, name ) {
1293+
elem = elem == window ?
1294+
windowData :
1295+
elem;
1296+
1297+
var id = elem[ expando ];
1298+
1299+
// If we want to remove a specific section of the element's data
1300+
if ( name ) {
1301+
if ( jQuery.cache[ id ] ) {
1302+
// Remove the section of cache data
1303+
delete jQuery.cache[ id ][ name ];
1304+
1305+
// If we've removed all the data, remove the element's cache
1306+
name = "";
1307+
1308+
for ( name in jQuery.cache[ id ] )
1309+
break;
1310+
1311+
if ( !name )
1312+
jQuery.removeData( elem );
1313+
}
1314+
1315+
// Otherwise, we want to remove all of the element's data
1316+
} else {
1317+
// Clean up the element expando
1318+
try {
1319+
delete elem[ expando ];
1320+
} catch(e){
1321+
// IE has trouble directly removing the expando
1322+
// but it's ok with using removeAttribute
1323+
if ( elem.removeAttribute )
1324+
elem.removeAttribute( expando );
1325+
}
1326+
1327+
// Completely remove the data cache
1328+
delete jQuery.cache[ id ];
1329+
}
1330+
},
1331+
queue: function( elem, type, data ) {
1332+
if ( elem ){
1333+
1334+
type = (type || "fx") + "queue";
1335+
1336+
var q = jQuery.data( elem, type );
1337+
1338+
if ( !q || jQuery.isArray(data) )
1339+
q = jQuery.data( elem, type, jQuery.makeArray(data) );
1340+
else if( data )
1341+
q.push( data );
1342+
1343+
}
1344+
return q;
1345+
},
1346+
1347+
dequeue: function( elem, type ){
1348+
var queue = jQuery.queue( elem, type ),
1349+
fn = queue.shift();
1350+
1351+
if( !type || type === "fx" )
1352+
fn = queue[0];
1353+
1354+
if( fn !== undefined )
1355+
fn.call(elem);
1356+
}
1357+
});
1358+
1359+
jQuery.fn.extend({
1360+
data: function( key, value ){
1361+
var parts = key.split(".");
1362+
parts[1] = parts[1] ? "." + parts[1] : "";
1363+
1364+
if ( value === undefined ) {
1365+
var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1366+
1367+
if ( data === undefined && this.length )
1368+
data = jQuery.data( this[0], key );
1369+
1370+
return data === undefined && parts[1] ?
1371+
this.data( parts[0] ) :
1372+
data;
1373+
} else
1374+
return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
1375+
jQuery.data( this, key, value );
1376+
});
1377+
},
1378+
1379+
removeData: function( key ){
1380+
return this.each(function(){
1381+
jQuery.removeData( this, key );
1382+
});
1383+
},
1384+
queue: function(type, data){
1385+
if ( typeof type !== "string" ) {
1386+
data = type;
1387+
type = "fx";
1388+
}
1389+
1390+
if ( data === undefined )
1391+
return jQuery.queue( this[0], type );
1392+
1393+
return this.each(function(){
1394+
var queue = jQuery.queue( this, type, data );
1395+
1396+
if( type == "fx" && queue.length == 1 )
1397+
queue[0].call(this);
1398+
});
1399+
},
1400+
dequeue: function(type){
1401+
return this.each(function(){
1402+
jQuery.dequeue( this, type );
1403+
});
1404+
}
14131405
});/*!
14141406
* Sizzle CSS Selector Engine - v0.9.3
14151407
* Copyright 2009, The Dojo Foundation
@@ -3269,7 +3261,7 @@ jQuery.fn.extend({
32693261
jQuery("<div/>")
32703262
// inject the contents of the document in, removing the scripts
32713263
// to avoid any 'Permission Denied' errors in IE
3272-
.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
3264+
.append(res.responseText.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*< *\/ *script *>?/gi, ""))
32733265

32743266
// Locate the specified elements
32753267
.find(selector) :

0 commit comments

Comments
 (0)