Skip to content

Commit

Permalink
[jan] Fix importing vCard fields with lowercase TYPE attributes (Bug …
Browse files Browse the repository at this point in the history
…#13006).
  • Loading branch information
yunosh committed Mar 10, 2014
1 parent 461d94e commit ea9828a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions turba/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.2.0-git
----------

[jan] Fix importing vCard fields with lowercase TYPE attributes (Bug #13006).
[jan] Don't remove missing contacts from distributions lists in Kolab backends
(Bug #12861).
[jan] Support binary fields (photos) in Kolab backends.
Expand Down
9 changes: 8 additions & 1 deletion turba/lib/Driver.php
Expand Up @@ -2226,6 +2226,9 @@ public function toHash(Horde_Icalendar_Vcard $vcard)
if (!is_array($item['params']['TYPE'])) {
$item['params']['TYPE'] = array($item['params']['TYPE']);
}
foreach ($item['params']['TYPE'] as &$type) {
$type = Horde_String::upper($type);
}
// For vCard 3.0.
if (in_array('CELL', $item['params']['TYPE'])) {
if (in_array('HOME', $item['params']['TYPE']) &&
Expand Down Expand Up @@ -2320,6 +2323,9 @@ public function toHash(Horde_Icalendar_Vcard $vcard)
if (!is_array($item['params']['TYPE'])) {
$item['params']['TYPE'] = array($item['params']['TYPE']);
}
foreach ($item['params']['TYPE'] as &$type) {
$type = Horde_String::upper($type);
}
if (in_array('HOME', $item['params']['TYPE']) &&
(!isset($hash['homeEmail']) ||
in_array('PREF', $item['params']['TYPE']))) {
Expand Down Expand Up @@ -2478,7 +2484,8 @@ public function toHash(Horde_Icalendar_Vcard $vcard)

// Ensure we have an 'email' field since we don't know for sure what
// the source is, therefore we don't know the mappings available. Fixes
// importing vCards that have all EMAIL properties with a TYPE attribute.
// importing vCards that have all EMAIL properties with a TYPE
// attribute.
// See Bug: 12955
if (!isset($hash['email'])) {
if (!empty($hash['homeEmail'])) {
Expand Down
2 changes: 2 additions & 0 deletions turba/package.xml
Expand Up @@ -40,6 +40,7 @@
</stability>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] Fix importing vCard fields with lowercase TYPE attributes (Bug #13006).
* [jan] Don&apos;t remove missing contacts from distributions lists in Kolab backends (Bug #12861).
* [jan] Support binary fields (photos) in Kolab backends.
* [mms] Allow tagging system to be disabled via configuration option.
Expand Down Expand Up @@ -1777,6 +1778,7 @@
<date>2013-08-15</date>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] Fix importing vCard fields with lowercase TYPE attributes (Bug #13006).
* [jan] Don&apos;t remove missing contacts from distributions lists in Kolab backends (Bug #12861).
* [jan] Support binary fields (photos) in Kolab backends.
* [mms] Allow tagging system to be disabled via configuration option.
Expand Down

0 comments on commit ea9828a

Please sign in to comment.