Skip to content

Commit

Permalink
Minor tweak to V1 docs url fix (#8587)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-runkle committed Jan 19, 2024
1 parent f0766c0 commit c6fc582
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/extra/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function sanitizeURL(url) {
}

function main() {
const fragment = location.hash.substr(1)
// escape nonstandard characters to avoid XSS attacks
const fragment = location.hash.substr(1).replace(/[^a-zA-Z0-9-_]/g, '')
if (fragment === '' || location.pathname !== '/') {
// no fragment or not called from root
return
Expand Down

0 comments on commit c6fc582

Please sign in to comment.