Set $oVCard->VERSION only once

This commit is contained in:
the-djmaze 2022-11-17 11:30:06 +01:00
parent 99816083ef
commit 30577b677a

View file

@ -531,12 +531,16 @@ class PdoAddressBook
$sUid = $sFirstName = $sLastName = $sMiddleName = $sSuffix = $sPrefix = '';
$iPrevId = $iId;
}
if (!isset($aVCards[$iId])) {
$aVCards[$iId] = new VCard;
if (isset($aVCards[$iId])) {
$oVCard = $aVCards[$iId];
} else {
$oVCard = new VCard;
// $oVCard = $oVCard->convert(VCard::VCARD40);
$oVCard->VERSION = '4.0';
$oVCard->PRODID = 'SnappyMail-'.APP_VERSION;
$aVCards[$iId] = $oVCard;
}
$oVCard = $aVCards[$iId];
$oVCard->VERSION = '4.0';
$oVCard->PRODID = 'SnappyMail-'.APP_VERSION;
$sPropValue = (string) $aItem['prop_value'];
$aTypes = array();
if (!empty($aItem['prop_type_str'])) {