fix possible security issue

This commit is contained in:
smthbh 2025-04-28 20:38:19 -04:00
parent f12e6bae79
commit 20516e1046
2 changed files with 6 additions and 2 deletions

View file

@ -132,7 +132,9 @@ document.addEventListener('DOMContentLoaded', function() {
const selected = compareSelect.value;
if (selected) {
const [realm, name] = selected.split('/');
window.location.href = `${window.location.pathname}/compare/${realm}/${name}`;
const sanitizedRealm = encodeURIComponent(realm);
const sanitizedName = encodeURIComponent(name);
window.location.href = `${window.location.pathname}/compare/${sanitizedRealm}/${sanitizedName}`;
}
});
});