You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
The change to use a strict comparison in \Laminas\Mime\Message::addPart (if ($part === $row) {) means that the given $part can contain the exact same data as the existing $row, but an exception will only be throw if they're the same instance. It shouldn't be possible to add two parts containing identical data.
How to reproduce
$part1 = (new \Laminas\Mime\Part('DATA'))->setId('ID');
$part2 = (new \Laminas\Mime\Part('DATA'))->setId('ID');
$message = new \Laminas\Mime\Message();
$message->addPart($part1);
$message->addPart($part2); // should throw \Laminas\Mime\Exception\InvalidArgumentException with message 'Provided part ID already defined.'
Workaround
For now, this can easily be worked around by doing something like:
$message = new \Laminas\Mime\Message();
$message->addPart($part1);
if (in_array($part1, $message->getParts())) {
return;
}
$message->addPart($part2);
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
The change to use a strict comparison in \Laminas\Mime\Message::addPart (
if ($part === $row) {
) means that the given$part
can contain the exact same data as the existing$row
, but an exception will only be throw if they're the same instance. It shouldn't be possible to add two parts containing identical data.How to reproduce
Workaround
For now, this can easily be worked around by doing something like:
The text was updated successfully, but these errors were encountered: