summaryrefslogtreecommitdiffstats
path: root/apps/contacts/lib/vcard.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-21 03:56:12 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-21 03:57:48 +0200
commit25dd0e940fca6a5f48cb224e0dcd7f13dbcf2728 (patch)
treeb0c20d610044f1445ed230417b1599c5636f61ca /apps/contacts/lib/vcard.php
parent8d38dc04a0d5565a6fa003af10a36f4ec70354dc (diff)
downloadnextcloud-server-25dd0e940fca6a5f48cb224e0dcd7f13dbcf2728.tar.gz
nextcloud-server-25dd0e940fca6a5f48cb224e0dcd7f13dbcf2728.zip
Preliminary support for Apple X-ABLabel. Also for oc-1508.
Diffstat (limited to 'apps/contacts/lib/vcard.php')
-rw-r--r--apps/contacts/lib/vcard.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 8c38f1ba15d..5bc3d04b468 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -562,6 +562,12 @@ class OC_Contacts_VCard{
foreach($object->children as $property){
$temp = self::structureProperty($property);
if(!is_null($temp)) {
+ if(isset($object->{$property->group . '.X-ABLABEL'})) {
+ $temp['label'] = $object->{$property->group . '.X-ABLABEL'}->value;
+ if($temp['label'] == '_$!<Other>!$_') {
+ $temp['label'] = OC_Contacts_App::$l10n->t('Other');
+ }
+ }
if(array_key_exists($property->name, $details)) {
$details[$property->name][] = $temp;
}
@@ -612,7 +618,7 @@ class OC_Contacts_VCard{
// Faulty entries by kaddressbook
// Actually TYPE=PREF is correct according to RFC 2426
// but this way is more handy in the UI. Tanghus.
- if($parameter->name == 'TYPE' && $parameter->value == 'PREF') {
+ if($parameter->name == 'TYPE' && strtoupper($parameter->value) == 'PREF') {
$parameter->name = 'PREF';
$parameter->value = '1';
}