Skip to content

Commit

Permalink
Fix code scanning alert issue-#1352 (#1505)
Browse files Browse the repository at this point in the history
* Fix code scanning alert issue-#1352

* Fix code scanning alert issue-#1352

---------

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
  • Loading branch information
JisanAR03 and DonnieBLT authored Oct 28, 2023
1 parent 22ddc4a commit f869d90
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions website/static/vendor/bootstrap/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ if (typeof jQuery === 'undefined') {
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
}
}(jQuery);

function sanitizeSelector(selector) {
// Use a whitelist approach to only allow valid characters in a selector
return selector.replace(/[^\w-#.:]/g, '');
}
/* ========================================================================
* Bootstrap: transition.js v3.3.7
* http://getbootstrap.com/javascript/#transitions
Expand Down Expand Up @@ -112,8 +115,8 @@ if (typeof jQuery === 'undefined') {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = $(selector === '#' ? [] : selector)
selector = sanitizeSelector(selector === '#' ? '' : selector);
var $parent = $(selector);

if (e) e.preventDefault()

Expand All @@ -139,7 +142,6 @@ if (typeof jQuery === 'undefined') {
removeElement()
}


// ALERT PLUGIN DEFINITION
// =======================

Expand Down

0 comments on commit f869d90

Please sign in to comment.