MimePart::getContentType() applies strtolower() on the result of getHeaderValue(). However, this result can be null even though the default value is provided as the default value is not used if the header is present but empty:
Content-Type:
In such cases, the result is null and PHP 8.1 complains:
strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
My fix applies the default value even if the header is present but empty as in the example above.
MimePart::getContentType()
appliesstrtolower()
on the result ofgetHeaderValue()
. However, this result can benull
even though the default value is provided as the default value is not used if the header is present but empty:In such cases, the result is
null
and PHP 8.1 complains:My fix applies the default value even if the header is present but empty as in the example above.