From b5c57e8d2a8b789b0021995b49dc4fd12f2b4281 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 4 Aug 2019 22:53:10 +0200 Subject: [PATCH] field escaping --- cards/update_card.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cards/update_card.sh b/cards/update_card.sh index b16ea05..c2b9720 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -61,16 +61,16 @@ for field in $(POST_KEYS |grep -xE '[A-Z][A-Z0-9-]*'); do # ;; TEL) vcf="$(pdi_update_attrib "$vcf" TEL $cnt TYPE="$(POST teltype $cnt |grep -Exm1 'HOME|WORK|CELL|FAX')")" - vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(POST "$field" "$cnt")")" + vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(vcf_escape "$(POST "$field" "$cnt")")")" ;; *) - vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(POST "$field" "$cnt")")" + vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(vcf_escape "$(POST "$field" "$cnt")")")" ;; esac done; done [ "$(POST action)" = addfield ] && vcf="$(vcf_update_field "$vcf" "$(POST newfield)" $(($(pdi_count $(POST newfield)) + 1)) '')" -printf '%s' "$vcf" >"$tempfile" +printf '%s' "$vcf" |grep -vx '' >"$tempfile" case "$(POST action)" in addfield) -- 2.39.2