Fix creation of UID in contacts

This commit is contained in:
Jakob Sack 2011-08-11 11:20:12 +02:00
parent 110f96df78
commit 4915610b5f
1 changed files with 6 additions and 1 deletions

View File

@ -167,7 +167,12 @@ class OC_Contacts_Addressbook{
$uri = $property->value.'.vcf';
}
}
if(is_null($uri)) $uri = self::createUID().'.vcf';
if(is_null($uri)){
$uid = self::createUID();
$uri = $uid.'.vcf';
$card->add(new Sabre_VObject_Property('UID',$uid));
$data = $card->serialize();
};
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));