1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

Cut some more off of the json response.

This commit is contained in:
Thomas Tanghus 2012-10-26 00:02:44 +02:00
parent de087c822f
commit 3ab079e781
4 changed files with 4 additions and 4 deletions

View File

@ -152,7 +152,7 @@ foreach ($parameters as $key=>$element) {
}
}
}
$checksum = md5($vcard->children[$line]->serialize());
$checksum = substr(md5($vcard->children[$line]->serialize()), 0, 8);
try {
OCA\Contacts\VCard::edit($id, $vcard);

View File

@ -174,7 +174,7 @@ if(!$value) {
}
// Do checksum and be happy
if(in_array($name, $multi_properties)) {
$checksum = md5($property->serialize());
$checksum = substr(md5($property->serialize()), 0, 8);
}
}
//debug('New checksum: '.$checksum);

View File

@ -55,7 +55,7 @@ class App {
public static function getPropertyLineByChecksum($vcard, $checksum) {
$line = null;
for($i=0;$i<count($vcard->children);$i++) {
if(md5($vcard->children[$i]->serialize()) == $checksum ) {
if(substr(md5($vcard->children[$i]->serialize()), 0, 8) == $checksum ) {
$line = $i;
break;
}

View File

@ -736,7 +736,7 @@ class VCard {
// This cuts around a 3rd off of the json response size.
if(in_array($property->name, App::$multi_properties)) {
$temp['checksum'] = md5($property->serialize());
$temp['checksum'] = substr(md5($property->serialize()), 0, 8);
}
foreach($property->parameters as $parameter) {
// Faulty entries by kaddressbook