Skip to content

Commit

Permalink
fix: strip html tags for gist file, gist line, gist highlight line, g…
Browse files Browse the repository at this point in the history
…ist show loading attrtributes
  • Loading branch information
jackycute committed Jun 9, 2021
1 parent 9e65e7a commit 94ba61b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public/js/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ export function finishView (view) {
// strip HTML tags to avoid stored XSS
const gistid = value.getAttribute('data-gist-id')
value.setAttribute('data-gist-id', stripTags(gistid))
const gistfile = value.getAttribute('data-gist-file')
if (gistfile) value.setAttribute('data-gist-file', stripTags(gistfile))
const gistline = value.getAttribute('data-gist-line')
if (gistline) value.setAttribute('data-gist-line', stripTags(gistline))
const gisthighlightline = value.getAttribute('data-gist-highlight-line')
if (gisthighlightline) value.setAttribute('data-gist-highlight-line', stripTags(gisthighlightline))
const gistshowloading = value.getAttribute('data-gist-show-loading')
if (gistshowloading) value.setAttribute('data-gist-show-loading', stripTags(gistshowloading))
$(value).gist(window.viewAjaxCallback)
}
})
Expand Down

0 comments on commit 94ba61b

Please sign in to comment.