Skip to content

Commit 2eefe77

Browse files
committed
fix: strip html tags for gist file, gist line, gist highlight line, gist show loading attrtributes
Signed-off-by: Max Wu <[email protected]>
1 parent 6966881 commit 2eefe77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

public/js/extra.js

+8
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ export function finishView (view) {
334334
// strip HTML tags to avoid stored XSS
335335
const gistid = value.getAttribute('data-gist-id')
336336
value.setAttribute('data-gist-id', stripTags(gistid))
337+
const gistfile = value.getAttribute('data-gist-file')
338+
if (gistfile) value.setAttribute('data-gist-file', stripTags(gistfile))
339+
const gistline = value.getAttribute('data-gist-line')
340+
if (gistline) value.setAttribute('data-gist-line', stripTags(gistline))
341+
const gisthighlightline = value.getAttribute('data-gist-highlight-line')
342+
if (gisthighlightline) value.setAttribute('data-gist-highlight-line', stripTags(gisthighlightline))
343+
const gistshowloading = value.getAttribute('data-gist-show-loading')
344+
if (gistshowloading) value.setAttribute('data-gist-show-loading', stripTags(gistshowloading))
337345
$(value).gist(window.viewAjaxCallback)
338346
}
339347
})

0 commit comments

Comments
 (0)