diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 3e59d85b65..ff4d1134f2 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -421,7 +421,7 @@ class addressbook_hooks { // Add users / groups this contact is shared with $entry['shared_with'] = []; - foreach($entry['shared'] as $id => $share) + foreach((array)$entry['shared'] as $id => $share) { $entry['shared_with'][] = $share['shared_with']; } diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index c354f3faf2..3270dece49 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -2229,7 +2229,7 @@ class addressbook_ui extends addressbook_bo if (is_array($content)) { // sync $content['shared'] with $content['shared_values'] - foreach($content['shared'] as $key => $shared) + foreach((array)$content['shared'] as $key => $shared) { $shared_value = $shared['shared_id'].':'.$shared['shared_with'].':'.$shared['shared_by'].':'.$shared['shared_writable']; if (($k = array_search($shared_value, (array)$content['shared_values'])) === false)