X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fjson.c;h=277bfe0cb44b700ad0a8b34502f6c6d3a9757f39;hb=1158e6626314814cd66c74880738168bba8b32bc;hp=d664700fa4850ef5d7e5426af9981fb7e5c0181d;hpb=4e037cf415c5f48647ddc37350c862084b07f03b;p=citadel.git diff --git a/libcitadel/lib/json.c b/libcitadel/lib/json.c index d664700fa..277bfe0cb 100644 --- a/libcitadel/lib/json.c +++ b/libcitadel/lib/json.c @@ -1,7 +1,7 @@ // // JSON data type and serializer for Citadel // -// Copyright (c) 1987-2018 by the citadel.org team +// Copyright (c) 1987-2023 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. @@ -197,7 +197,32 @@ void SerializeJson(StrBuf *Target, JsonValue *Val, int FreeVal) { switch (Val->Type) { case JSON_STRING: StrBufAppendBufPlain(Target, HKEY("\""), 0); - StrECMAEscAppend(Target, Val->Value, NULL); + int i; + char *plain = (char *)ChrPtr(Val->Value); + if (!IsEmptyStr(plain)) { + int len = strlen(plain); + for (i=0; i