diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-09-15 11:06:21 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-09-15 11:06:21 +0200 |
commit | c3ff534b19ec50dac75c6d1e54dff1d349f85000 (patch) | |
tree | 436e8515011eb488bb7a8d42906996a3d155779c /apps/contacts/ajax/addproperty.php | |
parent | b6c69e580a5f89026a59d380a4cfe42a84a53680 (diff) | |
download | nextcloud-server-c3ff534b19ec50dac75c6d1e54dff1d349f85000.tar.gz nextcloud-server-c3ff534b19ec50dac75c6d1e54dff1d349f85000.zip |
Improve reading of vCard files
Diffstat (limited to 'apps/contacts/ajax/addproperty.php')
-rw-r--r-- | apps/contacts/ajax/addproperty.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 68075efc6aa..70b2c8dcf82 100644 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -44,14 +44,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ exit(); } +$vcard = OC_Contacts_Addressbook::parse($card['carddata']); // Check if the card is valid -if( !OC_Contacts_Addressbook::isValidVObject($card['carddata'])){ +if(is_null($vcard)){ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Unable to parse vCard!')))); exit(); } -$vcard = Sabre_VObject_Reader::read($card['carddata']); - $name = $_POST['name']; $value = $_POST['value']; $parameters = isset($_POST['parameteres'])?$_POST['parameters']:array(); |