]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Fix adding N property in getContactVCard
authorBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 14:12:08 +0000 (15:12 +0100)
committerBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 14:14:24 +0000 (15:14 +0100)
apps/contacts/lib/app.php

index 5e58f9e928fd3b3aadd44aa7d46a69a35aa9029a..914b480e9b4909c35abd4348425fc23c9248db1e 100644 (file)
@@ -91,11 +91,11 @@ class OC_Contacts_App {
                        if($vcard->__isset('FN')) {
                                OC_Log::write('contacts','getContactVCard, found FN field: '.$vcard->__get('FN'), OC_Log::DEBUG);
                                $n = implode(';', array_reverse(array_slice(explode(' ', $vcard->__get('FN')), 0, 2))).';;;';
+                               $vcard->setString('N', $n);
                                OC_Contacts_VCard::edit( $id, $vcard->serialize());
                        } else { // Else just add an empty 'N' field :-P
                                $vcard->setString('N', 'Unknown;Name;;;');
                        }
-                       $vcard->setString('N', $n);
                }
                return $vcard;
        }