Skip to content

Fix AddressList toString method to quote semicolon #14

Closed
@weierophinney

Description

@weierophinney

Certain input of AddressList headers, cannot be converted to string and back to header object because of incorrect quoting:

From: "Foo;" <[email protected]>

gets incorrectly converted as

From: Foo; <[email protected]>

but ; is address separator, so it needs to be quoted:

From: "Foo;" <[email protected]>

The problem I discovered internally when using Storage\Message with Headers input, therefore testing that method is included in the unit test:

$message = new Message(['headers' => new Headers(), 'content' => (string)$body]);

// Mime\Decode::splitMessage calls toString on headers object which creates invalid result:
if ($message instanceof Headers) {
    $message = $message->toString();
}

Originally posted by @glensc at zendframework/zend-mail#230

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions