Accept an array as $input argument of decode_address_list()

... to support a common case and to prevent from PHP warnings.
pull/5735/head^2
Aleksander Machniak 8 years ago
parent 6bd349b7e6
commit 9a63e40faf

@ -84,7 +84,7 @@ class rcube_mime
/**
* Split an address list into a structured array list
*
* @param string $input Input string
* @param string|array $input Input string (or list of strings)
* @param int $max List only this number of addresses
* @param boolean $decode Decode address strings
* @param string $fallback Fallback charset if none specified
@ -94,6 +94,11 @@ class rcube_mime
*/
static function decode_address_list($input, $max = null, $decode = true, $fallback = null, $addronly = false)
{
// A common case when the same header is used many times in a mail message
if (is_array($input)) {
$input = implode(', ', $input);
}
$a = self::parse_address_list($input, $decode, $fallback);
$out = array();
$j = 0;

Loading…
Cancel
Save