Finalize vcard editing:
[citadel.git] / webcit / msg_renderers.c
index ec0ebd1b7205f894ccd12b7796e2b9ef32d09937..ed8de1fe96b56f26fbd66f6b68c5290f7071224a 100644 (file)
@@ -623,8 +623,9 @@ void render_MIME_VCard(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharse
                Buf = NewStrBuf();
                /** If it's my vCard I can edit it */
                if (    (!strcasecmp(ChrPtr(WCC->CurRoom.name), USERCONFIGROOM))
-                       || (!strcasecmp(&(ChrPtr(WCC->CurRoom.name)[11]), USERCONFIGROOM))
-                       || (WC->CurRoom.view == VIEW_ADDRESSBOOK)
+                       || ((StrLength(WCC->CurRoom.name) > 11) &&
+                           (!strcasecmp(&(ChrPtr(WCC->CurRoom.name)[11]), USERCONFIGROOM)))
+                       || (WCC->CurRoom.view == VIEW_ADDRESSBOOK)
                        ) {
                        StrBufAppendPrintf(Buf, "<a href=\"edit_vcard?msgnum=%ld?partnum=%s\">",
                                Mime->msgnum, ChrPtr(Mime->PartNum));
@@ -931,7 +932,7 @@ void tmplput_MAIL_SUMM_PERMALINK(StrBuf *Target, WCTemplputParams *TP)
 
        perma_link = NewStrBufPlain(HKEY("/readfwd?go="));
        StrBufUrlescAppend(perma_link, WC->CurRoom.name, NULL);
-       View = SBSTR("view");
+       View = sbstr("view");
        if (View != NULL) {
                StrBufAppendBufPlain(perma_link, HKEY("?view="), 0);
                StrBufAppendBuf(perma_link, View, 0);