mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
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.
This commit is contained in:
parent
0e89eb474d
commit
8edb6563b4
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user