Explorar o código

v-list-mail-account-autoreply: JSON export function fix for quotes and backslash

dpeca %!s(int64=8) %!d(string=hai) anos
pai
achega
a8d857f6d5
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      bin/v-list-mail-account-autoreply

+ 2 - 0
bin/v-list-mail-account-autoreply

@@ -20,6 +20,8 @@ source $VESTA/func/main.sh
 
 # JSON list function
 json_list() {
+    TO_ESCAPE='\\';
+    msg=$(echo "$msg" |sed -e "s|${TO_ESCAPE}|${TO_ESCAPE}${TO_ESCAPE}|g" -e 's/"/\\"/g' -e "s/%quote%/'/g")
     i='1'       # iterator
     echo '{'
     echo -e "\t\"$account\": {"