From b230d4468717726be942335658d9b5bd2635339f Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Wed, 6 May 2026 10:15:56 +0200 Subject: [PATCH] docs(admin/tables): clarify NUL sentinel in unescapeShellQuoting --- app/web/templates/admin_tables.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/web/templates/admin_tables.html b/app/web/templates/admin_tables.html index c0ce1b6..e86aa4e 100644 --- a/app/web/templates/admin_tables.html +++ b/app/web/templates/admin_tables.html @@ -1564,14 +1564,16 @@ // time so already-stored corrupt rows still display readably. function unescapeShellQuoting(s) { if (!s) return s; + // Order matters: protect real backslashes via NUL sentinel first, + // unescape the well-known sequences, then restore real backslashes. return s - .replace(/\\\\/g, ' ') + .replace(/\\\\/g, '') .replace(/\\n/g, '\n') .replace(/\\r/g, '\r') .replace(/\\t/g, '\t') .replace(/\\'/g, "'") .replace(/\\"/g, '"') - .replace(/ /g, '\\'); + .replace(//g, '\\'); } // C3: removed dead Discovery panel JS. The global Discovery card +