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
With this change in 6.0, the previously untyped FileLinkFormatter::$fileLinkFormat property now does not support strings anymore. As the default value of the constructor parameter $fileLinkFormat is null and FileLinkFormatter::FORMATS does not have an entry for null, after this line
…link_format (fancyweb)
This PR was merged into the 6.0 branch.
Discussion
----------
[HttpKernel] Fix FileLinkFormatter with empty xdebug.file_link_format
| Q | A
| ------------- | ---
| Branch? | 6.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #45272
| License | MIT
| Doc PR | -
`get_cfg_var('xdebug.file_link_format')` can return `'0'` or `''` and `$fileLinkFormat` will remain a string.
Alternative: we could add `|string` to the `$fileLinkFormat` property, it's already the case in some other parts of the code, but for this class at least I find it better to not add another type.
Commits
-------
1c60a5a [HttpKernel] Fix FileLinkFormatter with empty xdebug.file_link_format
Symfony version(s) affected
6.0
Description
With this change in 6.0, the previously untyped
FileLinkFormatter::$fileLinkFormat
property now does not support strings anymore. As the default value of the constructor parameter$fileLinkFormat
isnull
andFileLinkFormatter::FORMATS
does not have an entry fornull
, after this linesymfony/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php
Line 47 in d54ef8c
$fileLinkFormat
will be an empty string ifxdebug.file_link_format
is empty, which appears to be its default value. Thus,symfony/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php
Lines 48 to 51 in d54ef8c
is never entered and
symfony/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php
Line 53 in d54ef8c
throws a
TypeError
because astring
is assigned to anarray|false
variable.How to reproduce
xdebug.file_link_format
value:webapp
(as instructed in the documentation):(I added the explicit version number because I was also testing previous versions where the issue did not occur.)
Possible Solution
Properly handle the case of
$fileLinkFormat
being an empty string by settingFileLinkFormatter::$fileLinkFormat
to false.Additional Context
No response
The text was updated successfully, but these errors were encountered: