Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 419e220

Browse files
authored
Fix PHP 8.1 null values
Both `stripos` and `preg_match` will no longer accept `null` on PHP >= 8.1
1 parent aad1d09 commit 419e220

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ public static function closeOutputBuffers(int $targetLevel, bool $flush): void
12371237
*/
12381238
protected function ensureIEOverSSLCompatibility(Request $request): void
12391239
{
1240-
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) && true === $request->isSecure()) {
1240+
if (false !== stripos($this->headers->get('Content-Disposition') ?? '', 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT') ?? '', $match) && true === $request->isSecure()) {
12411241
if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) {
12421242
$this->headers->remove('Cache-Control');
12431243
}

0 commit comments

Comments
 (0)