From e6dc1c4fc593a00bc12161aa078498a12a064399 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Sat, 9 Oct 2021 04:12:07 +0300 Subject: [PATCH] update @ Sat 9 Oct 04:12:07 EEST 2021 --- content/js/shell/func.js | 2 +- content/js/shell/index.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/content/js/shell/func.js b/content/js/shell/func.js index d5bf991..5c2c8fc 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' : localStorage.getItem('username')} user.` } else { root = true; let ret = 'Command not found'; diff --git a/content/js/shell/index.js b/content/js/shell/index.js index 2d52572..92077a0 100644 --- a/content/js/shell/index.js +++ b/content/js/shell/index.js @@ -4,15 +4,6 @@ let cmd_history = document.getElementById('cmd_hist'); let shell = document.getElementById('shell'); var is_root = false; -const html_bad_tags = { - '&': '&', - '<': '<', - '>': '>' -}; - -function replaceTag(tag) { - return html_bad_tags[tag] || tag; -} function main() { cmd_prompt.onkeypress = (e) => { @@ -27,7 +18,7 @@ function main() { if (commands[command]) { if (commands[command]['root_only'] && !root) { - cmd_output.innerHTML = `'${command.replace(/[&<>]/g, replaceTag)}' can only be ran as root. see help su` + cmd_output.innerHTML = `'${command}' can only be ran as root. see help su` } else { cmd_output.innerHTML = commands[command]['func'](argv); }