[Pkg-owncloud-commits] [owncloud] 33/75: contacts: every card needs a version!

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:08:34 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v3.0.1
in repository owncloud.

commit d8cdec48fe035d9b3d04f1d235616cbfd43c07dc
Author: Jakob Sack <kde at jakobsack.de>
Date:   Wed Nov 9 11:34:04 2011 +0100

    contacts: every card needs a version!
---
 apps/contacts/lib/vcard.php |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 9f15cf4..ea04562 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -95,10 +95,15 @@ class OC_Contacts_VCard{
 
 		$card = self::parse($data);
 		if(!is_null($card)){
+			// VCARD must have a version
+			$hasversion = false;
 			foreach($card->children as $property){
 				if($property->name == 'FN'){
 					$fn = $property->value;
 				}
+				elseif($property->name == 'VERSION'){
+					$hasversion = true;
+				}
 				elseif(is_null($uri) && $property->name == 'UID' ){
 					$uri = $property->value.'.vcf';
 				}
@@ -109,6 +114,11 @@ class OC_Contacts_VCard{
 				$card->add(new Sabre_VObject_Property('UID',$uid));
 				$data = $card->serialize();
 			};
+			// Add version if needed
+			if(!$hasversion){
+				$card->add(new Sabre_VObject_Property('VERSION','3.0'));
+				$data = $card->serialize();
+			}
 		}
 		else{
 			// that's hard. Creating a UID and not saving it

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list