Yaffs site version 1.1
[yaffs-website] / vendor / symfony / serializer / Normalizer / ObjectNormalizer.php
index 0fde26975013f78a580607d4b3939f2d302e32cc..c31ba36a7a76ff618fb77670a292c0079f0ba68f 100644 (file)
@@ -208,10 +208,22 @@ class ObjectNormalizer extends AbstractNormalizer
 
             if (0 === strpos($name, 'get') || 0 === strpos($name, 'has')) {
                 // getters and hassers
 
             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
             } 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;
             }
         }
 
             }
         }