]> git.plutz.net Git - confetti/commitdiff
field escaping
authorPaul Hänsch <paul@plutz.net>
Sun, 4 Aug 2019 20:53:10 +0000 (22:53 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 4 Aug 2019 20:53:10 +0000 (22:53 +0200)
cards/update_card.sh

index b16ea0549c8548fd727d23b78de7ed6e54928ac5..c2b972069011faf5ff47d160259a4f70e5188255 100755 (executable)
@@ -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')")"
       #   ;;
       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)) '')"
 
         ;;
     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)
 
 case "$(POST action)" in
   addfield)