Changeset View
Changeset View
Standalone View
Standalone View
lib/Kolab/CardDAV/ContactsBackend.php
Show First 20 Lines • Show All 976 Lines • ▼ Show 20 Lines | private function _to_array($vc) | ||||
else | else | ||||
$val = $value; | $val = $value; | ||||
$type = strtolower((string)$prop->offsetGet('X-SERVICE-TYPE')); | $type = strtolower((string)$prop->offsetGet('X-SERVICE-TYPE')); | ||||
$protocol = $type && (!$prot || $prot == 'aim') ? ($this->improtocols[$type] ?: $type) : $prot; | $protocol = $type && (!$prot || $prot == 'aim') ? ($this->improtocols[$type] ?: $type) : $prot; | ||||
$contact['im'][] = ($this->improtocols[$protocol] ?: $protocol) . ':' . urldecode($val); | $contact['im'][] = ($this->improtocols[$protocol] ?: $protocol) . ':' . urldecode($val); | ||||
break; | break; | ||||
case 'PHOTO': | case 'PHOTO': | ||||
$param = $prop->offsetGet('encoding') ?: $prop->parameters[0]; | if ($prop instanceof VObject\Property\Binary && $value) { | ||||
if (($pvalue = $param->getValue()) && (strtolower($pvalue) == 'b' || strtolower($pvalue) == 'base64') || strtolower($param->name) == 'base64') { | |||||
$contact['photo'] = $value; | $contact['photo'] = $value; | ||||
} | } | ||||
else if ($prop instanceof VObject\Property\Uri && preg_match('|^data:image/[a-z]+;base64,|i', $value, $m)) { | |||||
$contact['photo'] = base64_decode(substr($value, strlen($m[0]))); | |||||
} | |||||
break; | break; | ||||
// VCard 4.0 properties | // VCard 4.0 properties | ||||
case 'FBURL': | case 'FBURL': | ||||
$contact['freebusyurl'] = $value; | $contact['freebusyurl'] = $value; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |