Permalink
Browse files

bug #27365 [Serializer] Check the value of enable_max_depth if define…

…d (dunglas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Check the value of enable_max_depth if defined

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

Because it confuses some users that `['enable_max_depth' => false]` actually triggers the check.

Commits
-------

e88e0f3 [Serializer] Check the value of enable_max_depth if defined
  • Loading branch information...
nicolas-grekas committed May 25, 2018
2 parents f8e21fd + e88e0f3 commit cb106fa2ff993ec0dea0632bc2f955b5342f3c28
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
@@ -331,6 +331,7 @@ private function isMaxDepthReached(array $attributesMetadata, $class, $attribute
{
if (
!isset($context[static::ENABLE_MAX_DEPTH]) ||
!$context[static::ENABLE_MAX_DEPTH] ||
!isset($attributesMetadata[$attribute]) ||
null === $maxDepth = $attributesMetadata[$attribute]->getMaxDepth()
) {

0 comments on commit cb106fa

Please sign in to comment.