Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Sanitize input when changing locale to prevent XSS
  • Loading branch information
Nonononoki committed Jul 19, 2021
1 parent d4be216 commit 01ae69d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/resources/templates/fragments.html
Expand Up @@ -136,7 +136,9 @@
function onChangeLocal(e) {
let val = e.options[e.selectedIndex].value;
console.log(val);
window.location.search = val;
if (val.includes('?lang=') && val.length == 8) {
window.location.search = val;
}
}
</script>
</footer>
Expand Down

0 comments on commit 01ae69d

Please sign in to comment.