Skip to content

[VarDumper] Use unique identifier for RequestContextProvider #61246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 6.4
Choose a base branch
from

Conversation

ToshY
Copy link
Contributor

@ToshY ToshY commented Jul 26, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #61130
License MIT

Creates unique identifier for vardumper when running bin/console server:dump / bin/console server:dump --format=html. The fix in the RequestContextProvider now uses hash('crc32b') in combination with $_SERVER['REQUEST_TIME_FLOAT'], which is the same as the CliContextProvider.

@carsonbot

This comment has been minimized.

@ToshY ToshY changed the base branch from 7.4 to 6.4 July 26, 2025 18:05
@ToshY
Copy link
Contributor Author

ToshY commented Jul 26, 2025

Hey!

Thanks for your PR. You are targeting branch "7.4" but it seems your PR description refers to branch "6.4". Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

Accidently clicked to fast on create PR. As it's a bug, based and targeted on 6.4, so label should be 6.4.

@carsonbot carsonbot changed the title Use unique identifier for RequestContextProvider [VarDumper] Use unique identifier for RequestContextProvider Jul 26, 2025
@OskarStark OskarStark modified the milestones: 7.4, 6.4 Jul 26, 2025
@@ -45,7 +45,7 @@ public function getContext(): ?array
'uri' => $request->getUri(),
'method' => $request->getMethod(),
'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller,
'identifier' => spl_object_hash($request),
'identifier' => hash('crc32b', spl_object_hash($request).$_SERVER['REQUEST_TIME_FLOAT']),
Copy link
Contributor

@Spomky Spomky Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolas-grekas xxh128 is already used elsewhere in Symfony for its excellent performance, low collision risk, and suitability for non-cryptographic identifiers.
Should we switch to xxh128 here and in CliContextProvider as well?

@OskarStark OskarStark changed the title [VarDumper] Use unique identifier for RequestContextProvider [VarDumper] Use unique identifier for RequestContextProvider Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VarDumper] spl_object_hash($request) is identical leading to hidden information for sections
4 participants