diff --git a/jquery.ba-bbq.js b/jquery.ba-bbq.js index 3a5995d..c054e20 100644 --- a/jquery.ba-bbq.js +++ b/jquery.ba-bbq.js @@ -6,6 +6,15 @@ * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ + +/* + * Additional changes to this file: + * - Removed support for IE8 and below https://github.com/cowboy/jquery-bbq/pull/48 + * - Fixed prototype pollution (CVE-2021-20086) https://github.com/cowboy/jquery-bbq/pull/61 + * - Minified with `uglifyjs jquery.ba-bbq.js --compress --comments -o jquery.ba-bbq.min.js` + * + * See Yii Framework which is also maintaining a fork: https://github.com/yiisoft/yii/pull/4563 + */ // Script: jQuery BBQ: Back Button & Query Library // @@ -464,7 +473,7 @@ // (Object) An object representing the deserialized params string. $.deparam = jq_deparam = function( params, coerce ) { - var obj = {}, + var obj = Object.create(null), coerce_types = { 'true': !0, 'false': !1, 'null': null }; // Iterate over all name=value pairs. @@ -521,7 +530,7 @@ for ( ; i <= keys_last; i++ ) { key = keys[i] === '' ? cur.length : keys[i]; cur = cur[key] = i < keys_last - ? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? {} : [] ) + ? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? Object.create(null) : [] ) : val; } @@ -1281,96 +1290,6 @@ timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay ); }; - // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv - // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - $.browser.msie && !supports_onhashchange && (function(){ - // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8 - // when running in "IE7 compatibility" mode. - - var iframe, - iframe_src; - - // When the event is bound and polling starts in IE 6/7, create a hidden - // Iframe for history handling. - self.start = function(){ - if ( !iframe ) { - iframe_src = $.fn[ str_hashchange ].src; - iframe_src = iframe_src && iframe_src + get_fragment(); - - // Create hidden Iframe. Attempt to make Iframe as hidden as possible - // by using techniques from http://www.paciellogroup.com/blog/?p=604. - iframe = $('