aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/showsetproperty.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/ajax/showsetproperty.php')
-rw-r--r--apps/contacts/ajax/showsetproperty.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/contacts/ajax/showsetproperty.php b/apps/contacts/ajax/showsetproperty.php
index 75c3ff88f5f..a00043384f3 100644
--- a/apps/contacts/ajax/showsetproperty.php
+++ b/apps/contacts/ajax/showsetproperty.php
@@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_GET['id'];
-$line = $_GET['line'];
$checksum = $_GET['checksum'];
$l10n = new OC_L10N('contacts');
@@ -47,7 +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();
}
@@ -56,7 +61,7 @@ if(md5($vcard->children[$line]->serialize()) != $checksum){
$tmpl = new OC_Template('contacts','part.setpropertyform');
$tmpl->assign('id',$id);
$tmpl->assign('checksum',$checksum);
-$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line],$line));
+$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line]));
$page = $tmpl->fetchPage();
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));