aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-18 15:16:26 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-18 15:21:37 +0100
commit8edb6563b4f70e3b16518ef9f00a688e64aa7609 (patch)
tree14bc195ae6b01d6f640e4bbcebab7dfa64bd7069
parentMerge pull request #10221 from lucaswerkmeister/bash-completion (diff)
downloadsystemd-8edb6563b4f70e3b16518ef9f00a688e64aa7609.tar.gz
systemd-8edb6563b4f70e3b16518ef9f00a688e64aa7609.tar.bz2
systemd-8edb6563b4f70e3b16518ef9f00a688e64aa7609.zip
json: do not unescape slashes
Apparently this originated in PHP, so the json output could be directly embedded in HTML script tags. See https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped. Since the output of our tools is not intended directly for web page generation, let's not do this unescaping. If needed, the consumer can always do escaping as appropriate for the target format.
-rw-r--r--src/shared/json.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/shared/json.c b/src/shared/json.c
index c410b6200..59c461759 100644
--- a/src/shared/json.c
+++ b/src/shared/json.c
@@ -1381,10 +1381,6 @@ static int json_format(FILE *f, JsonVariant *v, JsonFormatFlags flags, const cha
fputs("\\\\", f);
break;
- case '/':
- fputs("\\/", f);
- break;
-
case '\b':
fputs("\\b", f);
break;