Skip to content

Commit

Permalink
Prevent cross-site scripting(XSS) vulnerabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
notrinos committed Aug 16, 2022
1 parent a7c9546 commit 0362778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions SECURITY.md
Expand Up @@ -2,8 +2,7 @@

## Reporting a Vulnerability

Please share privately the details of your security vulnerability by email to:
[Contact Info](support@notrinos.com)
Please share privately the details of your security vulnerability by email to: support@notrinos.com
Or open an issue at [our forum](https://forums.notrinos.com/t/bugs-problems)

Make sure to include as much information as possible, with the detailed steps to reproduce the problem,
Expand Down
5 changes: 3 additions & 2 deletions libraries/select.js
Expand Up @@ -15,9 +15,10 @@ var loadSelect2 = {
if((e.hasAttribute('multiple') === false) && $(e).hasClass('nosearch') === false) {
$(e).select2({
dropdownAutoWidth : true,
// break a select option item into multi lines
templateResult: function(item) {
var selectionText = item.text.split('\n');
// replace(/</g, '&lt;') : prevent the code in the option’s value from being executed by the browser.
// split('\n') : break a select option item into multi lines
var selectionText = item.text.replace(/</g, '&lt;').split('\n');
var returnString = $('<span></span>');
$.each(selectionText, function(index, value){
line = value === undefined ? '' : value;
Expand Down

0 comments on commit 0362778

Please sign in to comment.