Skip to content

Commit

Permalink
Fix a regression where some contact data was missing in export and PH…
Browse files Browse the repository at this point in the history
…P warnings were logged (Kolab #4522)
  • Loading branch information
alecpl committed Feb 16, 2015
1 parent 9ed6d46 commit e25b0d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions program/steps/addressbook/export.inc
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ function prepare_for_export(&$record, $source = null)

foreach ($record as $key => $values) {
list($field, $section) = explode(':', $key);
// avoid casting DateTime objects to array
// avoid unwanted casting of DateTime objects to an array
// (same as in rcube_contacts::convert_save_data())
if (is_object($values) && is_a($values, 'DateTime')) {
$values = array(0 => $values);
$values = array($values);
}
foreach ($values as $value) {

foreach ((array) $values as $value) {
if (is_array($value) || is_a($value, 'DateTime') || @strlen($value)) {
$vcard->set($field, $value, strtoupper($section));
}
Expand Down

0 comments on commit e25b0d7

Please sign in to comment.