* In a rare eureka-moment, discovered that my XML string escape function was only...
authorArt Cancro <ajc@citadel.org>
Thu, 20 May 2010 17:54:51 +0000 (17:54 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 20 May 2010 17:54:51 +0000 (17:54 +0000)
citadel/modules/xmpp/serv_xmpp.c
citadel/modules/xmpp/xmpp_presence.c

index d9271e46469235b1fdc731e47bd6186e7f7a6d4b..31656c18b7c3b9f7a1ae91733c89f34ca370a3a9 100644 (file)
@@ -95,11 +95,16 @@ char *xmlesc(char *buf, char *str, int bufsiz)
                        strcpy(&buf[len], "&amp;");
                        len += 5;
                }
-               else if (ch <= 0x7F) {
+               else if ((ch >= 0x20) && (ch <= 0x7F)) {
                        buf[len++] = ch;
                        buf[len] = 0;
                }
-               else if (ch > 0x7F) {
+               else if (ch < 0x20) {
+                       /* we probably shouldn't be doing this */
+                       buf[len++] = '_';
+                       buf[len] = 0;
+               }
+               else {
                        char oct[10];
                        sprintf(oct, "&#%o;", ch);
                        strcpy(&buf[len], oct);
index e1621a9048d71ab50473bb7975bc4988723f2c54..2866daa97c1a432440dd0c31eb18e17abf26c614 100644 (file)
@@ -303,6 +303,14 @@ void xmpp_store_mortuary(HashList *mortuary) {
        }
        DeleteHashPos(&HashPos);
 
+       /* FIXME temp crap 
+       StrBufAppendPrintf(themsg, "foo@bar.com\n");
+       StrBufAppendPrintf(themsg, "baz@quux.com\n");
+       StrBufAppendPrintf(themsg, "haha%c\n", 1);
+       StrBufAppendPrintf(themsg, "baaaz@quux.com\n");
+       StrBufAppendPrintf(themsg, "baaaz@quuuuuux.com\n");
+       */
+
        /* Delete the old mortuary */
        CtdlDeleteMessages(USERCONFIGROOM, NULL, 0, XMPPMORTUARY);