]> code.citadel.org Git - citadel.git/blobdiff - webcit/html2html.c
* output_html(): it needs to be isspace()src="cid: not <blank>src="cid:
[citadel.git] / webcit / html2html.c
index 2e19e58e9eecb08b40c269573a11173b817532dc..91bac48eaa4b3ae96e991780eac3394a8a1ea72c 100644 (file)
@@ -369,7 +369,7 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
                if (!strncasecmp(ptr, "<a href=\"mailto:", 16)) {
                        content_length += 64;
                        StrBufAppendPrintf(converted_msg,
-                                       "<a href=\"display_enter?force_room=_MAIL_&recp=");
+                                       "<a href=\"display_enter?force_room=_MAIL_?recp=");
                        ptr = &ptr[16];
                        ++alevel;
                        ++brak;
@@ -397,8 +397,9 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
                }
                /** Fixup <img src="cid:... ...> to fetch the mime part */
                else if (!strncasecmp(ptr, "<img ", 5)) {
+                       char *cid_start, *cid_end;
                        char* tag_end=strchr(ptr,'>');
-
+                       char* src;
                        /* FIXME - handle this situation (maybe someone opened an <img cid... 
                         * and then ended the message)
                         */
@@ -408,11 +409,11 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
                                lprintf(9, "Theoretical bytes remaining: %d\n", msgend - ptr);
                        }
 
-                       char* src=strstr(ptr, " src=\"cid:");
-                       char *cid_start, *cid_end;
+                       src=strstr(ptr, "src=\"cid:");
                        ++brak;
 
                        if (src
+                           && isspace(*(src-1))
                                && tag_end
                                && (cid_start=strchr(src,':'))
                                && (cid_end=strchr(cid_start,'"'))