11( function ( ) {
22/*
3- * jQuery 1.2.6 - New Wave Javascript
3+ * jQuery 1.2.7-sec - New Wave Javascript
44 *
55 * Copyright (c) 2008 John Resig (jquery.com)
66 * Dual licensed under the MIT (MIT-LICENSE.txt)
77 * and GPL (GPL-LICENSE.txt) licenses.
88 *
9- * $Date: 2008/05/26 $
10- * $Rev: 5685 $
9+ * $Date$
10+ * $Rev$
1111 */
1212
1313// Map over jQuery in case of overwrite
@@ -21,8 +21,9 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) {
2121} ;
2222
2323// 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 - ] * ) ) $ / ,
2627
2728// Is it a simple selector
2829 isSimple = / ^ .[ ^ : # \[ \. ] * $ / ,
@@ -55,13 +56,13 @@ jQuery.fn = jQuery.prototype = {
5556
5657 // HANDLE: $("#id")
5758 else {
58- var elem = document . getElementById ( match [ 3 ] ) ;
59+ var elem = document . getElementById ( match [ 2 ] ) ;
5960
6061 // Make sure an element was located
6162 if ( elem ) {
6263 // Handle the case where IE and Opera return items
6364 // by name instead of ID
64- if ( elem . id != match [ 3 ] )
65+ if ( elem . id != match [ 2 ] )
6566 return jQuery ( ) . find ( selector ) ;
6667
6768 // Otherwise, we inject the element directly into the jQuery object
@@ -84,7 +85,7 @@ jQuery.fn = jQuery.prototype = {
8485 } ,
8586
8687 // The current version of jQuery being used
87- jquery : "1.2.6 " ,
88+ jquery : "1.2.7-sec " ,
8889
8990 // The number of elements contained in the matched element set
9091 size : function ( ) {
@@ -576,8 +577,9 @@ jQuery.extend = jQuery.fn.extend = function() {
576577 for ( var name in options ) {
577578 var src = target [ name ] , copy = options [ name ] ;
578579
580+ // Prevent Object.prototype pollution
579581 // Prevent never-ending loop
580- if ( target === copy )
582+ if ( name === "__proto__" || target === copy )
581583 continue ;
582584
583585 // Recurse if we're merging object values
@@ -952,13 +954,6 @@ jQuery.extend({
952954
953955 // Convert html string into DOM nodes
954956 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-
962957 // Trim whitespace, otherwise indexOf won't work as expected
963958 var tags = jQuery . trim ( elem ) . toLowerCase ( ) , div = context . createElement ( "div" ) ;
964959
@@ -2463,7 +2458,7 @@ jQuery.fn.extend({
24632458 jQuery ( "<div/>" )
24642459 // inject the contents of the document in, removing the scripts
24652460 // 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 , "" ) )
24672462
24682463 // Locate the specified elements
24692464 . find ( selector ) :
0 commit comments