Fix PHP 8.1 null values

Both `stripos` and `preg_match` will no longer accept `null` on PHP >= 8.1
This commit is contained in:
Kyle 2021-02-14 19:51:53 +01:00 committed by GitHub
parent aad1d094a5
commit 419e2206f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1237,7 +1237,7 @@ class Response
*/
protected function ensureIEOverSSLCompatibility(Request $request): void
{
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) && true === $request->isSecure()) {
if (false !== stripos($this->headers->get('Content-Disposition') ?? '', 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT') ?? '', $match) && true === $request->isSecure()) {
if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) {
$this->headers->remove('Cache-Control');
}