Thomas Bruederli
2015-01-07 37757464fd4d603b7f8cd3038d5c85a2f92de855
Correctly handle DateTime values in Vcard export
1 files modified
9 ■■■■ changed files
program/steps/addressbook/export.inc 9 ●●●● patch | view | raw | blame | history
program/steps/addressbook/export.inc
@@ -131,8 +131,13 @@
        foreach ($record as $key => $values) {
            list($field, $section) = explode(':', $key);
            foreach ((array)$values as $value) {
                if (is_array($value) || @strlen($value)) {
            // avoid casting DateTime objects to array
            // (same as in rcube_contacts::convert_save_data())
            if (is_object($values) && is_a($values, 'DateTime')) {
                $values = array(0 => $values);
            }
            foreach ($values as $value) {
                if (is_array($value) || is_a($value, 'DateTime') || @strlen($value)) {
                    $vcard->set($field, $value, strtoupper($section));
                }
            }