diff --git a/src/Header/ContentDisposition.php b/src/Header/ContentDisposition.php index 5594afb8..4e3165a5 100644 --- a/src/Header/ContentDisposition.php +++ b/src/Header/ContentDisposition.php @@ -148,7 +148,11 @@ public function getFieldValue($format = HeaderInterface::FORMAT_RAW) $decodedLength = strlen($value); $maxValueLength -= ($encodedLength - $decodedLength); } - + + // there are cases when the value becomes less than 1, str_split tell "Warning: str_split(): The length of each segment must be greater than zero" + if ( $maxValueLength < 1 ) + $maxValueLength = 1; + $valueParts = str_split($value, $maxValueLength); $i = 0; foreach ($valueParts as $valuePart) {