** Part of fix for bug #489043
authorMilan Crha <mcrha@redhat.com>
Fri, 22 Feb 2008 10:30:23 +0000 (10:30 +0000)
committerMilan Crha <mcrha@src.gnome.org>
Fri, 22 Feb 2008 10:30:23 +0000 (10:30 +0000)
2008-02-22  Milan Crha  <mcrha@redhat.com>

** Part of fix for bug #489043

* libebook/e-vcard.c: (e_vcard_to_string_vcard_30):
Do not store quotes in param values when quoting, it is not allowed.

svn path=/trunk/; revision=8519

addressbook/ChangeLog
addressbook/libebook/e-vcard.c

index 5508630..d222877 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-22  Milan Crha  <mcrha@redhat.com>
+
+       ** Part of fix for bug #489043
+
+       * libebook/e-vcard.c: (e_vcard_to_string_vcard_30):
+       Do not store quotes in param values when quoting, it is not allowed.
+
 2008-02-21  Milan Crha  <mcrha@redhat.com>
 
        ** Fix for bug #517885
index 3514fa8..cd1dd57 100644 (file)
@@ -850,11 +850,24 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
                                                }
                                                pval = g_utf8_next_char (pval);
                                        }
-                                       if (quotes)
+
+                                       if (quotes) {
+                                               int i;
+
                                                g_string_append_c (attr_str, '"');
-                                       g_string_append (attr_str, value);
-                                       if (quotes)
+
+                                               for (i = 0; value [i]; i++) {
+                                                       /* skip quotes in quoted string; it is not allowed */
+                                                       if (value [i] == '\"')
+                                                               continue;
+
+                                                       g_string_append_c (attr_str, value [i]);
+                                               }
+
                                                g_string_append_c (attr_str, '"');
+                                       } else
+                                               g_string_append (attr_str, value);
+
                                        if (v->next)
                                                g_string_append_c (attr_str, ',');
                                }