1
1
( function ( ) {
2
2
/*
3
- * jQuery 1.2.6 - New Wave Javascript
3
+ * jQuery 1.2.7-sec - New Wave Javascript
4
4
*
5
5
* Copyright (c) 2008 John Resig (jquery.com)
6
6
* Dual licensed under the MIT (MIT-LICENSE.txt)
7
7
* and GPL (GPL-LICENSE.txt) licenses.
8
8
*
9
- * $Date: 2008/05/26 $
10
- * $Rev: 5685 $
9
+ * $Date$
10
+ * $Rev$
11
11
*/
12
12
13
13
// Map over jQuery in case of overwrite
@@ -21,8 +21,9 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) {
21
21
} ;
22
22
23
23
// A simple way to check for HTML strings or ID strings
24
- // (both of which we optimize for)
25
- var quickExpr = / ^ [ ^ < ] * ( < ( .| \s ) + > ) [ ^ > ] * $ | ^ # ( \w + ) $ / ,
24
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
25
+ // Strict HTML recognition (#11290: must start with <)
26
+ quickExpr = / ^ (?: ( < [ \w \W ] + > ) [ ^ > ] * | # ( [ \w - ] * ) ) $ / ,
26
27
27
28
// Is it a simple selector
28
29
isSimple = / ^ .[ ^ : # \[ \. ] * $ / ,
@@ -55,13 +56,13 @@ jQuery.fn = jQuery.prototype = {
55
56
56
57
// HANDLE: $("#id")
57
58
else {
58
- var elem = document . getElementById ( match [ 3 ] ) ;
59
+ var elem = document . getElementById ( match [ 2 ] ) ;
59
60
60
61
// Make sure an element was located
61
62
if ( elem ) {
62
63
// Handle the case where IE and Opera return items
63
64
// by name instead of ID
64
- if ( elem . id != match [ 3 ] )
65
+ if ( elem . id != match [ 2 ] )
65
66
return jQuery ( ) . find ( selector ) ;
66
67
67
68
// Otherwise, we inject the element directly into the jQuery object
@@ -84,7 +85,7 @@ jQuery.fn = jQuery.prototype = {
84
85
} ,
85
86
86
87
// The current version of jQuery being used
87
- jquery : "1.2.6 " ,
88
+ jquery : "1.2.7-sec " ,
88
89
89
90
// The number of elements contained in the matched element set
90
91
size : function ( ) {
@@ -576,8 +577,9 @@ jQuery.extend = jQuery.fn.extend = function() {
576
577
for ( var name in options ) {
577
578
var src = target [ name ] , copy = options [ name ] ;
578
579
580
+ // Prevent Object.prototype pollution
579
581
// Prevent never-ending loop
580
- if ( target === copy )
582
+ if ( name === "__proto__" || target === copy )
581
583
continue ;
582
584
583
585
// Recurse if we're merging object values
@@ -952,13 +954,6 @@ jQuery.extend({
952
954
953
955
// Convert html string into DOM nodes
954
956
if ( typeof elem == "string" ) {
955
- // Fix "XHTML"-style tags in all browsers
956
- elem = elem . replace ( / ( < ( \w + ) [ ^ > ] * ?) \/ > / g, function ( all , front , tag ) {
957
- return tag . match ( / ^ ( a b b r | b r | c o l | i m g | i n p u t | l i n k | m e t a | p a r a m | h r | a r e a | e m b e d ) $ / i) ?
958
- all :
959
- front + "></" + tag + ">" ;
960
- } ) ;
961
-
962
957
// Trim whitespace, otherwise indexOf won't work as expected
963
958
var tags = jQuery . trim ( elem ) . toLowerCase ( ) , div = context . createElement ( "div" ) ;
964
959
@@ -2463,7 +2458,7 @@ jQuery.fn.extend({
2463
2458
jQuery ( "<div/>" )
2464
2459
// inject the contents of the document in, removing the scripts
2465
2460
// to avoid any 'Permission Denied' errors in IE
2466
- . append ( res . responseText . replace ( / < s c r i p t ( . | \s ) * ? \/ s c r i p t > / g , "" ) )
2461
+ . append ( res . responseText . replace ( / < s c r i p t \b [ ^ < ] * (?: (? ! < \/ s c r i p t > ) < [ ^ < ] * ) * < * \/ * s c r i p t * > ? / gi , "" ) )
2467
2462
2468
2463
// Locate the specified elements
2469
2464
. find ( selector ) :
0 commit comments