Skip to content

Commit

Permalink
Bug: 12955 Fix importing vCards when using only 'email' attribute.
Browse files Browse the repository at this point in the history
Fixes importing vCards that have TYPE attributes on all  EMAIL properties,
yet the import destination mapping contains only the 'email' attribute.
  • Loading branch information
mrubinsk committed Feb 5, 2014
1 parent 7bf69c3 commit 396feb0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions turba/lib/Driver.php
Expand Up @@ -2465,6 +2465,18 @@ 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.
// See Bug: 12955
if (!isset($hash['email']))
if (!empty($hash['homeEmail'])) {
$hash['email'] = Horde_Icalendar_Vcard::getBareEmail($hash['homeEmail']);
} else if (!empty($hash['workEmail'])) {
$hash['email'] = Horde_Icalendar_Vcard::getBareEmail($hash['workEmail']);
}
}

return $hash;
}

Expand Down

0 comments on commit 396feb0

Please sign in to comment.