summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/deleteproperty.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/deleteproperty.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/deleteproperty.php')
-rw-r--r--apps/contacts/ajax/deleteproperty.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php
index 9f8b5dbbaf1..d141cc00b8d 100644
--- a/apps/contacts/ajax/deleteproperty.php
+++ b/apps/contacts/ajax/deleteproperty.php
@@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_GET['id'];
-$line = $_GET['line'];
$checksum = $_GET['checksum'];
@@ -50,8 +49,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();
}