Skip to content

Commit abf1e74

Browse files
Replace tabulation with \u0009 (hestiacp#2089)
Tabulators in the value field will break the list of records. This probably should be made in a more global scale, as the json_decode function in my php server (PHP Version 7.4.22, running on Debian 10.10 4.19.0-17-amd64 hestiacp#1 SMP Debian 4.19.194-2 (2021-06-21) x86_64 ) is returning an empty value if a value contains a tabulator (in my case a user introduced a TXT record that had a leading tab character). I have read that the json spec wants tabulations represented by \t or \u0009.
1 parent 60b80ec commit abf1e74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/v-list-dns-records

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ json_list() {
3131
unset TTL
3232
parse_object_kv_list "$str"
3333
[ -z "$TTL" ] && TTL="$zone_ttl"
34-
VALUE=$(echo "$VALUE" |sed -e 's/"/\\"/g' -e "s/%quote%/'/g")
34+
VALUE=$(echo "$VALUE" |sed -e 's/"/\\"/g' -e "s/%quote%/'/g" -e 's/ /\\u0009/g')
3535
echo -n ' "'$ID'": {
3636
"RECORD": "'$RECORD'",
3737
"TYPE": "'$TYPE'",

0 commit comments

Comments
 (0)