8000 [Serializer] Added check of constuctor modifiers to AbstractNormalizer · alexpott/symfony@eb0e14c · GitHub
[go: up one dir, main page]

Skip to content

Commit eb0e14c

Browse files
dmitrii-tfabpot
authored andcommitted
[Serializer] Added check of constuctor modifiers to AbstractNormalizer
1 parent 2b73460 commit eb0e14c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
333333

334334
$constructor = $this->getConstructor($data, $class, $context, $reflectionClass, $allowedAttributes);
335335
if ($constructor) {
336+
if (true !== $constructor->isPublic()) {
337+
return $reflectionClass->newInstanceWithoutConstructor();
338+
}
339+
336340
$constructorParameters = $constructor->getParameters();
337341

338342
$params = [];

0 commit comments

Comments
 (0)
0