mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-09 19:53:14 +08:00
Update admin interface (#4737)
- Updated datatables - Set Cookie Secure flag if the connection is https - Prevent possible XSS via Organization Name Converted all `innerHTML` and `innerText` to the Safe Sink version `textContent` - Removed `jsesc` function as handlebars escapes all these chars already and more by default
This commit is contained in:
committed by
GitHub
parent
035f694d2f
commit
54bfcb8bc3
4
src/static/scripts/admin.js
vendored
4
src/static/scripts/admin.js
vendored
@@ -98,7 +98,7 @@ const showActiveTheme = (theme, focus = false) => {
|
||||
const themeSwitcherText = document.querySelector("#bd-theme-text");
|
||||
const activeThemeIcon = document.querySelector(".theme-icon-active use");
|
||||
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`);
|
||||
const svgOfActiveBtn = btnToActive.querySelector("span use").innerText;
|
||||
const svgOfActiveBtn = btnToActive.querySelector("span use").textContent;
|
||||
|
||||
document.querySelectorAll("[data-bs-theme-value]").forEach(element => {
|
||||
element.classList.remove("active");
|
||||
@@ -107,7 +107,7 @@ const showActiveTheme = (theme, focus = false) => {
|
||||
|
||||
btnToActive.classList.add("active");
|
||||
btnToActive.setAttribute("aria-pressed", "true");
|
||||
activeThemeIcon.innerText = svgOfActiveBtn;
|
||||
activeThemeIcon.textContent = svgOfActiveBtn;
|
||||
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;
|
||||
themeSwitcher.setAttribute("aria-label", themeSwitcherLabel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user