1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-23 07:48:55 +00:00

Only modify window.location when redirecting (fixes #4133)

window.location.pathname = window.location.pathname can trigger a redirect,
which created a refresh loop in usage.html.
This commit is contained in:
Milkey Mouse 2019-02-20 11:12:45 -08:00
parent 091bd2bd79
commit 7ea2bd1389
No known key found for this signature in database
GPG key ID: C6EF5A02F5647987

View file

@ -17,7 +17,10 @@ Usage
// Redirect to general docs
if(hash == "") {
window.location.pathname = window.location.pathname.replace("usage.html", "usage/general.html");
var replaced = window.location.pathname.replace("usage.html", "usage/general.html");
if (replaced != window.location.pathname) {
window.location.pathname = replaced;
}
}
// Fixup anchored links from when usage.html contained all the commands
else if(hash.startsWith("borg-key") || hash == "borg-change-passphrase") {