X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fserializer%2FNormalizer%2FObjectNormalizer.php;h=c31ba36a7a76ff618fb77670a292c0079f0ba68f;hp=0fde26975013f78a580607d4b3939f2d302e32cc;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/symfony/serializer/Normalizer/ObjectNormalizer.php b/vendor/symfony/serializer/Normalizer/ObjectNormalizer.php index 0fde26975..c31ba36a7 100644 --- a/vendor/symfony/serializer/Normalizer/ObjectNormalizer.php +++ b/vendor/symfony/serializer/Normalizer/ObjectNormalizer.php @@ -208,10 +208,22 @@ class ObjectNormalizer extends AbstractNormalizer if (0 === strpos($name, 'get') || 0 === strpos($name, 'has')) { // getters and hassers - $attributes[lcfirst(substr($name, 3))] = true; + $propertyName = substr($name, 3); + + if (!$reflClass->hasProperty($propertyName)) { + $propertyName = lcfirst($propertyName); + } + + $attributes[$propertyName] = true; } elseif (strpos($name, 'is') === 0) { // issers - $attributes[lcfirst(substr($name, 2))] = true; + $propertyName = substr($name, 2); + + if (!$reflClass->hasProperty($propertyName)) { + $propertyName = lcfirst($propertyName); + } + + $attributes[$propertyName] = true; } }