Bug 1427382 - don't use header display name straight off, in case it contains @ (analysis by Magnus Melin). r=mkmelin
This commit is contained in:
Родитель
7d87de3301
Коммит
09bacfca85
|
@ -422,10 +422,21 @@ nsMsgDBView::FetchAuthor(nsIMsgDBHdr * aHdr,
|
|||
{
|
||||
// We can't use the display name in the card; use the name contained in
|
||||
// the header or email address.
|
||||
if (!name.IsEmpty())
|
||||
aSenderString = name;
|
||||
else
|
||||
if (name.IsEmpty()) {
|
||||
CopyUTF8toUTF16(emailAddress, aSenderString);
|
||||
} else {
|
||||
uint32_t atPos;
|
||||
if ((atPos = name.FindChar('@')) == kNotFound ||
|
||||
name.FindChar('.', atPos) == kNotFound) {
|
||||
aSenderString = name;
|
||||
} else {
|
||||
// Found @ followed by a dot, so this looks like a spoofing case.
|
||||
aSenderString = name;
|
||||
aSenderString.AppendLiteral(" <");
|
||||
AppendUTF8toUTF16(emailAddress, aSenderString);
|
||||
aSenderString.Append('>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateCachedName(aHdr, "sender_name", aSenderString);
|
||||
|
|
Загрузка…
Ссылка в новой задаче