Skip to content

Commit

Permalink
checking security
Browse files Browse the repository at this point in the history
  • Loading branch information
JisanAR03 committed Oct 31, 2023
1 parent fe7d07a commit 525973f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [ cc ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [ cc ]
schedule:
- cron: '36 16 * * 2'

Expand Down
13 changes: 12 additions & 1 deletion website/static/vendor/bootstrap/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function sanitizeSelector(selector) {
// Use a whitelist approach to only allow valid characters in a selector
return selector.replace(/[^\w-#.:]/g, '');
}
function sanitizeInput(input) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(input));
return div.innerHTML;
}
/* ========================================================================
* Bootstrap: transition.js v3.3.7
* http://getbootstrap.com/javascript/#transitions
Expand Down Expand Up @@ -1576,7 +1581,13 @@ function sanitizeSelector(selector) {

Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = escapeHTML(this.getTitle())
var title = this.getTitle()
if(this.options.html){
title = sanitizeInput(title);
}
else{
title = sanitizeSelector(title);
}

$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
Expand Down

0 comments on commit 525973f

Please sign in to comment.