Skip to content

Commit

Permalink
Make the space optional after a comma separator
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0adam committed Sep 15, 2023
1 parent 0966e53 commit a49c8fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ private function decodeAddresses($values): array {
}

foreach ($values as $address) {
foreach (preg_split('/, (?=(?:[^"]*"[^"]*")*[^"]*$)/', $address) as $split_address) {
foreach (preg_split('/, ?(?=(?:[^"]*"[^"]*")*[^"]*$)/', $address) as $split_address) {
$split_address = trim(rtrim($split_address));

if (strpos($split_address, ",") == strlen($split_address) - 1) {
Expand Down

0 comments on commit a49c8fb

Please sign in to comment.