-
-
Notifications
You must be signed in to change notification settings - Fork 92
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: symfony/http-kernel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.1.9
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: symfony/http-kernel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.1.10
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 9 commits
- 6 files changed
- 3 contributors
Commits on Nov 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8838b5b - Browse repository at this point
Copy the full SHA 8838b5bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92673a5 - Browse repository at this point
Copy the full SHA 92673a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 451a858 - Browse repository at this point
Copy the full SHA 451a858View commit details
Commits on Dec 9, 2024
-
[HttpKernel] Denormalize request data using the csv format when using…
… "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data)
Configuration menu - View commit details
-
Copy full SHA for b846efb - Browse repository at this point
Copy the full SHA b846efbView commit details -
bug #59134 [HttpKernel] Denormalize request data using the csv format…
… when using "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data) (ovidiuenache) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [HttpKernel] Denormalize request data using the csv format when using "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data) | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | #59104 #50904 | License | MIT This fixes the scenario mentioned above where using `#[MapQueryString]` or `#[MapRequestPayload]` (except request content) with at least one readonly property with a type mismatch error leads to getting an object with uninitialized properties. The only properties that are set are the ones that are assigned a value via a request parameter and are NOT readonly. Moreover, if the corresponding query parameter is not provided for non-readonly property A and there is at least one other readonly property B that has a type mismatch then A will still be returned as uninitialized (even if it has a default value). Shortly put, the instantiation fails and the values of the properties cannot be set later on. Examples ``` class FilterDto { public function __construct( public readonly ?int $id = null, public readonly ?string $name = null, public ?string $description = null, ) { } } GET https://127.0.0.1:8000/test?id=x&name=test id: ? ?int name: ? ?string description: ? ?string GET https://127.0.0.1:8000/test?id=x&name=test&description=desc id: ? ?int name: ? ?string description: "desc" ``` The complete list of steps to reproduce this is provided in #59104. The reason why this happens is because we are disabling the type enforcement of the denormalizer in the `Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver` class and when we eventually end up in the `validateAndDenormalize` method of the `Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer` class we ignore the type mismatch because of: ``` if ($context[self::DISABLE_TYPE_ENFORCEMENT] ?? $this->defaultContext[self::DISABLE_TYPE_ENFORCEMENT] ?? false) { return $data; } ``` Thus, we get a type error when trying to create the object and we fall back to `$reflectionClass->newInstanceWithoutConstructor();` Then, based on the provided request data, we attempt to set the values of the properties but this process fails for the readonly properties so they stay uninitialized. As discussed with `@nicolas`-grekas during [the hackathon at SymfonyCon Vienna 2024](https://live.symfony.com/2024-vienna-con/) the solution here is to stop disabling the type enforcement of the denormalizer. However, this alone is not enough because then we won't be able to use anything but string since this is the type that comes in the request so we also need to set the denormalization format to either `csv` or `xml`. This comment from `the Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer` sheds some light on why: ``` // In XML and CSV all basic datatypes are represented as strings, it is e.g. not possible to determine, // if a value is meant to be a string, float, int or a boolean value from the serialized representation. // That's why we have to transform the values, if one of these non-string basic datatypes is expected. ``` We avoid `xml` due to some special formatting that occurs so the proposed solution uses `csv`. Basically, we start using type enforcement + csv format where non-string values are transformed. Commits ------- e0957a0b33b [HttpKernel] Denormalize request data using the csv format when using "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data)
Configuration menu - View commit details
-
Copy full SHA for 661cb10 - Browse repository at this point
Copy the full SHA 661cb10View commit details
Commits on Dec 11, 2024
-
* 6.4: [BeanstalkMessenger] Round delay to an integer to avoid deprecation warning [PropertyInfo] Fix interface handling in `PhpStanTypeHelper` [HttpClient] Test POST to GET redirects [HttpKernel] Denormalize request data using the csv format when using "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data) fix: preserve and nowrap in profiler code highlighting
Configuration menu - View commit details
-
Copy full SHA for ec3423a - Browse repository at this point
Copy the full SHA ec3423aView commit details
Commits on Dec 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0c7fa99 - Browse repository at this point
Copy the full SHA 0c7fa99View commit details -
* 6.4: relax assertions on generated hashes [Messenger] ensure exception on rollback does not hide previous exception require the writer to implement getFormats() in the translation:extract don't require fake notifier transports to be installed as non-dev dependencies Remove 5.4 branch from PR template [Scheduler] Fix optional count variable in testGetNextRunDates
Configuration menu - View commit details
-
Copy full SHA for 0c902cb - Browse repository at this point
Copy the full SHA 0c902cbView commit details
Commits on Dec 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f4cab1e - Browse repository at this point
Copy the full SHA f4cab1eView commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v7.1.9...v7.1.10