Update WebToPersonCapture.php fix #209 and #258

Fix #209 and #258 
Was worked on PHP 7 and failed on PHP 8.
Now works on both PHP 7 and PHP 8.
This commit is contained in:
Chris Coleman 2023-05-17 17:29:40 -04:00 committed by Clemente Raposo
parent cce3b3e3f9
commit bf759c0597

View file

@ -143,7 +143,7 @@ if (isset($_POST['campaign_id']) && !empty($_POST['campaign_id'])) {
} elseif (preg_match('/^' . $optInPrefix . '/', $k)) {
$optInEmailFields[] = substr($k, strlen($optInPrefix));
} else {
if (array_key_exists($k, $person) || array_key_exists($k, $person->field_defs)) {
if (property_exists($person, $k) || array_key_exists($k, $person->field_defs)) {
if (in_array($k, $possiblePersonCaptureFields)) {
if (is_array($v)) {
$v = encodeMultienumValue($v);