Skip to content

Commit

Permalink
Sanitize user input with DOMPurify.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Sep 15, 2023
1 parent 3143625 commit 63cce91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/roi/ROIMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ROIMenu {

const callback = () => {

const value = this.browser.inputDialog.input.value || ''
const value = this.browser.inputDialog.value || ''
feature.name = value.trim()

this.container.style.display = 'none'
Expand Down
6 changes: 3 additions & 3 deletions js/ui/menuUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function visibilityWindowMenuItem(trackView) {

const callback = () => {

let value = trackView.browser.inputDialog.input.value
let value = trackView.browser.inputDialog.value
value = '' === value || undefined === value ? -1 : value.trim()

trackView.track.visibilityWindow = Number.parseInt(value)
Expand Down Expand Up @@ -247,7 +247,7 @@ function trackRenameMenuItem(trackView) {
const click = e => {

const callback = function () {
let value = trackView.browser.inputDialog.input.value
let value = trackView.browser.inputDialog.value
value = ('' === value || undefined === value) ? 'untitled' : value.trim()
trackView.track.name = value
}
Expand Down Expand Up @@ -276,7 +276,7 @@ function trackHeightMenuItem(trackView) {

const callback = () => {

const number = Number(trackView.browser.inputDialog.input.value, 10)
const number = Number(trackView.browser.inputDialog.value, 10)

if (undefined !== number) {

Expand Down
2 changes: 1 addition & 1 deletion js/version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const _version = "2.15.10"
const _version = "2.15.11"
function version() {
return _version
}
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igv",
"version": "2.15.10",
"version": "2.15.11",
"main": "dist/igv.esm.js",
"browser": "dist/igv.js",
"module": "dist/igv.esm.js",
Expand All @@ -15,7 +15,7 @@
"build": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config",
"build_iife": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config rollup.config.iife.js",
"updateCSS": "node scripts/generateEmbedCss.cjs",
"test": "mocha -ui tdd"
"test": "node test/utils/forceESM.cjs && mocha -ui tdd"
},
"author": {
"name": "Jim Robinson"
Expand Down Expand Up @@ -43,6 +43,7 @@
},
"browserslist": "> 1%, not dead",
"devDependencies": {
"html2canvas": "^1.4.1",
"@rollup/plugin-strip": "^3.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@xmldom/xmldom": "^0.7.9",
Expand All @@ -52,7 +53,7 @@
"circular-view": "github:igvteam/circular-view#v0.2.4",
"eslint": "^6.4.0",
"hdf5-indexed-reader": "github:jrobinso/hdf5-indexed-reader#v0.5.2",
"igv-ui": "github:igvteam/igv-ui#v1.5.0",
"igv-ui": "github:igvteam/igv-ui#v1.5.2",
"igv-utils": "github:igvteam/igv-utils#v1.4.8",
"mocha": "^10.2.0",
"rollup": "^2.66.0",
Expand Down

0 comments on commit 63cce91

Please sign in to comment.