diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-02-16 11:22:40 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-02-16 11:22:40 +0100 |
commit | ae73c26f29aa230ba5ae3d86ef6d0c7886b7e657 (patch) | |
tree | faf979010b4d12b64b1d10ebd04d67b37d20790c /program | |
parent | 3779b67a9c9db42e40ec865f81e6370bc0971810 (diff) | |
parent | e25b0d7781edf02f15401078430c8d40f5c9e544 (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/addressbook/export.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc index d2507c13c..c2f22cbe2 100644 --- a/program/steps/addressbook/export.inc +++ b/program/steps/addressbook/export.inc @@ -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)); } |