all split()[0] are safe for url-redirect

This commit is contained in:
Erik Krogh Kristensen
2020-05-07 10:55:17 +02:00
parent a3fb13882b
commit 945fe45b6f
2 changed files with 6 additions and 1 deletions

View File

@@ -3,4 +3,7 @@ function foo() {
var urlParts = document.location.href.split('?');
var loc = urlParts[0] + "?" + boxes.value;
window.location = loc
// Also OK.
window.location.replace(window.location.href.split("#")[0] + "#mappage");
}