If data is already a Horde_iCalendar object, use it instead of creating a new one

This commit is contained in:
Nathan Gray 2012-09-18 15:06:19 +00:00
parent 65bf21742a
commit 67289c346b

View File

@ -553,12 +553,17 @@ class addressbook_vcal extends addressbook_bo
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php');
$container = false;
$vCard = Horde_iCalendar::newComponent('vcard', $container);
if (!$vCard->parsevCalendar($_vcard, 'VCARD', $charset))
if(!($_vcard instanceof Horde_iCalendar))
{
return False;
$container = false;
$vCard = Horde_iCalendar::newComponent('vcard', $container);
if (!$vCard->parsevCalendar($_vcard, 'VCARD', $charset))
{
return False;
}
} else {
$vCard = $_vcard;
}
$vcardValues = $vCard->getAllAttributes();