Commit 5a05e05f authored by Rémi Gaillard's avatar Rémi Gaillard

[-] FO: Fix #PSCFV-4960 recursion with json_encode on some php versions

parent dffa9ed2
......@@ -491,7 +491,12 @@ class AddressFormatCore extends ObjectModel
$layoutData['ordered'] = AddressFormat::getOrderedAddressFields((int)$address->id_country);
$layoutData['formated'] = AddressFormat::getFormattedAddressFieldsValues($address, $layoutData['ordered']);
$layoutData['object'] = get_object_vars($address);
$layoutData['object'] = array();
$reflect = new ReflectionObject($address);
$public_properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach ($public_properties as $property)
$layoutData['object'][$property->getName()] = $address->{$property->getName()};
return $layoutData;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment