From cfe45488b6c1809c95d02d9091786071f891d30c Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Sun, 10 Oct 2021 04:29:16 +0300 Subject: [PATCH] update @ Sun 10 Oct 04:29:16 EEST 2021 --- content/js/generic/index.js | 2 +- content/js/shell/func.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/js/generic/index.js b/content/js/generic/index.js index f2419f8..5c95d65 100644 --- a/content/js/generic/index.js +++ b/content/js/generic/index.js @@ -21,7 +21,7 @@ async function main() { }, 3: { "type": 'ok', - "text": `Found user account: ${localStorage.getItem('username')}` + "text": `Found user account: ${localStorage.getItem('username') ? escape_HTML(localStorage.getItem('username')) : ''}` }, 4: { "type": 'ok', diff --git a/content/js/shell/func.js b/content/js/shell/func.js index c74bd78..aa8bb2b 100644 --- a/content/js/shell/func.js +++ b/content/js/shell/func.js @@ -117,7 +117,7 @@ function su(cmd) { if (cmd[0]) { if (cmd[0] == '.') { root = !root - return `Switched to the ${root ? 'root' : localStorage.getItem('username')} user.` + return `Switched to the ${root ? 'root' : escape_HTML(localStorage.getItem('username'))} user.` } else { root = true; let ret = 'Command not found'; @@ -163,7 +163,7 @@ function passwd() { function whoami() { - return root ? "root" : window.localStorage.getItem("username"); + return root ? "root" : escape_HTML(window.localStorage.getItem("username")); }