bug #40188 [HttpFoundation] Fix PHP 8.1 null values (kylekatarnls)
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Fix PHP 8.1 null values
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Both `stripos` and `preg_match` will no longer accept `null` on PHP >= 8.1
Commits
-------
419e2206f4
Fix PHP 8.1 null values
This commit is contained in:
commit
eab91556a6
@ -1237,7 +1237,7 @@ class Response
|
|||||||
*/
|
*/
|
||||||
protected function ensureIEOverSSLCompatibility(Request $request): void
|
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) {
|
if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) {
|
||||||
$this->headers->remove('Cache-Control');
|
$this->headers->remove('Cache-Control');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user