mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Better check for inline images
SVN revision: 2241
This commit is contained in:
parent
f32db8164a
commit
bebd33c05d
17
src/elogd.c
17
src/elogd.c
@ -22795,7 +22795,7 @@ void copy_to(LOGBOOK * lbs, int src_id, char *dest_logbook, int move, int orig_i
|
|||||||
|
|
||||||
int is_inline_attachment(char *encoding, int message_id, char *text, int i, char *att)
|
int is_inline_attachment(char *encoding, int message_id, char *text, int i, char *att)
|
||||||
{
|
{
|
||||||
char str[256], att_enc[256], domain[256];
|
char str[256], att_enc[256], domain[256], *pt, *p;
|
||||||
|
|
||||||
if (text == NULL)
|
if (text == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -22809,8 +22809,19 @@ int is_inline_attachment(char *encoding, int message_id, char *text, int i, char
|
|||||||
} else if (strieq(encoding, "HTML")) {
|
} else if (strieq(encoding, "HTML")) {
|
||||||
strlcpy(att_enc, att, sizeof(att_enc));
|
strlcpy(att_enc, att, sizeof(att_enc));
|
||||||
att_enc[13] = '/';
|
att_enc[13] = '/';
|
||||||
if (stristr(text, att_enc))
|
pt = text;
|
||||||
return 1;
|
while (stristr(pt, att_enc)) {
|
||||||
|
/* make sure that it's really an inline image */
|
||||||
|
for (p = stristr(pt, att_enc) ; p > pt ; p--)
|
||||||
|
if (*p == '<')
|
||||||
|
break;
|
||||||
|
if (p > pt) {
|
||||||
|
strncpy(str, p, 5);
|
||||||
|
if (stristr(str, "<img "))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
pt = stristr(pt, att_enc)+1;
|
||||||
|
}
|
||||||
retrieve_domain(domain, sizeof(domain));
|
retrieve_domain(domain, sizeof(domain));
|
||||||
sprintf(str, "cid:att%d@%s", i, domain);
|
sprintf(str, "cid:att%d@%s", i, domain);
|
||||||
if (stristr(text, str))
|
if (stristr(text, str))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user