diff --git a/src/Header/ContentType.php b/src/Header/ContentType.php index 44a61ecd47..df67954956 100644 --- a/src/Header/ContentType.php +++ b/src/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; }