aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/setproperty.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-08-09 17:42:54 +0200
committerJakob Sack <kde@jakobsack.de>2011-08-09 17:42:54 +0200
commitc6f499c68551b216f59292801c3ebb91fb08e8e4 (patch)
tree075169413709d6881facf3c875f6a4a3aba772fa /apps/contacts/ajax/setproperty.php
parent6d1c266e1e21e5fab56220df7529401c6c1729be (diff)
downloadnextcloud-server-c6f499c68551b216f59292801c3ebb91fb08e8e4.tar.gz
nextcloud-server-c6f499c68551b216f59292801c3ebb91fb08e8e4.zip
Some more fixes. It basically works but looks ugly
Diffstat (limited to 'apps/contacts/ajax/setproperty.php')
-rw-r--r--apps/contacts/ajax/setproperty.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php
index 6f33c68631a..08d8892254e 100644
--- a/apps/contacts/ajax/setproperty.php
+++ b/apps/contacts/ajax/setproperty.php
@@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_POST['id'];
-$line = $_POST['line'];
$checksum = $_POST['checksum'];
$l10n = new OC_L10N('contacts');
@@ -47,8 +46,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
-
-if(md5($vcard->children[$line]->serialize()) != $checksum){
+$line = null;
+for($i=0;$i<count($vcard->children);$i++){
+ if(md5($vcard->children[$i]->serialize()) == $checksum ){
+ $line = $i;
+ }
+}
+if(is_null($line)){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
exit();
}