Skip to content

Commit 0d28a1d

Browse files
author
Emmanuel BORGES
committed
Fix getSetMethodNormalizer to correctly ignore the attributes specified in IGNORED_ATTRIBUTES
1 parent e74e0f9 commit 0d28a1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

UPGRADE-4.2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,12 @@ FrameworkBundle
179179
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been deprecated, use the `trans()` one instead with a `%count%` parameter.
180180
* Deprecated support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
181181
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been deprecated.
182+
* The `GetSetMethodNormalizer` class correctly ignores the attributes specified in `AbstractNormalizer::IGNORED_ATTRIBUTES`.
182183

183184
HttpFoundation
184185
--------------
185186

186-
* The default value of the `$secure` and `$samesite` arguments of Cookie's constructor
187+
* The default value of the `$secure` and `$samesite` arguments o`f Cookie's constructor
187188
will respectively change from `false` to `null` and from `null` to `lax` in Symfony
188189
5.0, you should define their values explicitly or use `Cookie::create()` instead.
189190

src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function extractAttributes($object, $format = null, array $context = [
110110

111111
$attributeName = lcfirst(substr($method->name, 0 === strpos($method->name, 'is') ? 2 : 3));
112112

113-
if ($this->isAllowedAttribute($object, $attributeName)) {
113+
if ($this->isAllowedAttribute($object, $attributeName, null, $context)) {
114114
$attributes[] = $attributeName;
115115
}
116116
}

0 commit comments

Comments
 (0)