Bug 1170002 Display name with comma in it does not get properly quoted in From field r=Ratty

This commit is contained in:
Neil Rashbrook 2015-06-07 22:38:17 +01:00
Родитель ec557543c1
Коммит 6ab6a7f26a
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1042,7 +1042,7 @@ function ComposeStartup(recycled, aParams)
identityList.selectedItem =
identityList.getElementsByAttribute("identitykey", params.identity.key)[0];
if (params.composeFields.from)
identityList.value = params.composeFields.from;
identityList.value = MailServices.headerParser.parseDecodedHeader(params.composeFields.from)[0].toString();
LoadIdentity(true);
if (sMsgComposeService)
{
@ -1369,7 +1369,9 @@ function GenericSendMessage( msgType )
if (msgCompFields)
{
Recipients2CompFields(msgCompFields);
msgCompFields.from = GetMsgIdentityElement().value;
var address = GetMsgIdentityElement().value;
address = MailServices.headerParser.makeFromDisplayAddress(address);
msgCompFields.from = MailServices.headerParser.makeMimeHeader(address, 1);
var subject = GetMsgSubjectElement().value;
msgCompFields.subject = subject;
Attachments2CompFields(msgCompFields);