fix problem when vcf-cards have double carriage returns (such as crcrlf) this seems to break the v-card

This commit is contained in:
Klaus Leithoff 2012-08-27 12:27:05 +00:00
parent 96b4b5cda9
commit aced2ccd99

View File

@ -1193,6 +1193,9 @@
if (strtoupper($attachment['type']) == 'TEXT/X-VCARD')
{
$addressbook_vcal = new addressbook_vcal();
// double \r\r\n seems to end a vcard prematurely, so we set them to \r\n
//error_log(__METHOD__.__LINE__.$attachment['attachment']);
$attachment['attachment'] = str_replace("\r\r\n", "\r\n", $attachment['attachment']);
$vcard = $addressbook_vcal->vcardtoegw($attachment['attachment']);
//error_log(print_r($vcard,true));
if ($vcard['uid']) $contact = $addressbook_vcal->find_contact($vcard,false);