Escape single and double quotes in export format
[citadel.git] / citadel / modules / migrate / serv_migrate.c
index 9b997e132c9b815d4301dffbbc0caeae5ef4716a..4eeb576e5955ac9ebbe8d59362c80a88147dc0ab 100644 (file)
@@ -86,8 +86,11 @@ void xml_strout(char *str) {
        char *c = str;
 
        while (*c != 0) {
-               if (*c == '&') {
-                       client_write("&", 5);
+               if (*c == '\"') {
+                       client_write(""", 4);
+               }
+               else if (*c == '\'') {
+                       client_write("'", 4);
                }
                else if (*c == '<') {
                        client_write("&lt;", 4);
@@ -95,6 +98,9 @@ void xml_strout(char *str) {
                else if (*c == '>') {
                        client_write("&gt;", 4);
                }
+               else if (*c == '&') {
+                       client_write("&amp;", 5);
+               }
                else {
                        client_write(c, 1);
                }