Skip to content

Commit

Permalink
Fix trimming of adressess with array_map (#32)
Browse files Browse the repository at this point in the history
[array_map)(https://www.php.net/manual/en/function.array-map.php) returns new array as result, it does not work on the passed array in-place. This is true for PHP versions back to 4.3.0 (https://3v4l.org/FkJHL), the lowest available version on 3v4l.org.

This was first introduced in 4bab560 and probably never worked since then.
  • Loading branch information
Ammarpad authored Oct 20, 2023
1 parent c1e7303 commit 8cfaa01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mail/RFC822.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ protected function _validateAddress($address)
}

// Trim the whitespace from all of the address strings.
array_map('trim', $addresses);
$addresses = array_map('trim', $addresses);

// Validate each mailbox.
// Format could be one of: name <geezer@domain.com>
Expand Down

0 comments on commit 8cfaa01

Please sign in to comment.