You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fatal error occurs when parsing the Accept header if it only consists of semi-colons.
Fatal error: Uncaught TypeError: Symfony\Component\HttpFoundation\AcceptHeaderItem::__construct(): Argument #1 ($value) must be of type string, null given, called in /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php on line 56 and defined in /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeaderItem.php on line 26
TypeError: Symfony\Component\HttpFoundation\AcceptHeaderItem::__construct(): Argument #1 ($value) must be of type string, null given, called in /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php on line 56 in /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeaderItem.php on line 26
Call Stack:
0.0001 497448 1. {main}() /Users/reza/Code/http-foundation-bug/src/run.php:0
0.0015 704056 2. Symfony\Component\HttpFoundation\AcceptHeader::fromString($headerValue = ';;;') /Users/reza/Code/http-foundation-bug/src/run.php:8
0.0018 739616 3. array_map($callback = class Closure { }, $array = [0 => []]) /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php:51
0.0018 739936 4. Symfony\Component\HttpFoundation\AcceptHeader::Symfony\Component\HttpFoundation\{closure:/Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php:51-60}($subParts = []) /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php:51
0.0024 741184 5. Symfony\Component\HttpFoundation\AcceptHeaderItem->__construct($value = NULL, $attributes = []) /Users/reza/Code/http-foundation-bug/vendor/symfony/http-foundation/AcceptHeader.php:56
How to reproduce
<?php
include "../vendor/autoload.php";
use Symfony\Component\HttpFoundation\AcceptHeader;
var_dump(
AcceptHeader::fromString(";;;")
);
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
This PR was merged into the 5.4 branch.
Discussion
----------
[HttpFoundation] filter out empty HTTP header parts
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#54868
| License | MIT
Commits
-------
7d6d8cd filter out empty HTTP header parts
Symfony version(s) affected
7.0.7
Description
A fatal error occurs when parsing the Accept header if it only consists of semi-colons.
How to reproduce
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: