diff --git a/library/Zend/Http/Header/ContentType.php b/library/Zend/Http/Header/ContentType.php index 44a61ecd477..df67954956b 100644 --- a/library/Zend/Http/Header/ContentType.php +++ b/library/Zend/Http/Header/ContentType.php @@ -248,7 +248,13 @@ protected function assembleValue() protected function splitMediaTypesFromString($criteria) { $mediaTypes = explode(',', $criteria); - array_walk($mediaTypes, 'trim'); + array_walk( + $mediaTypes, + function (&$value) { + $value = trim($value); + } + ); + return $mediaTypes; } diff --git a/library/Zend/Mail/Header/AbstractAddressList.php b/library/Zend/Mail/Header/AbstractAddressList.php index 4ccd38bba3f..87f76c7734c 100644 --- a/library/Zend/Mail/Header/AbstractAddressList.php +++ b/library/Zend/Mail/Header/AbstractAddressList.php @@ -58,7 +58,12 @@ public static function fromString($headerLine) // split value on "," $fieldValue = str_replace(Headers::FOLDING, ' ', $fieldValue); $values = explode(',', $fieldValue); - array_walk($values, 'trim'); + array_walk( + $values, + function (&$value) { + $value = trim($value); + } + ); $addressList = $header->getAddressList(); foreach ($values as $address) {