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

Merge pull request #733 from owncloud/colon_space

fix bug with colon and space in vcard import
This commit is contained in:
jbtbnl 2014-12-09 15:46:11 +01:00
commit f167153e9b

View File

@ -198,20 +198,9 @@ class ImportVCardConnector extends ImportConnector{
// Doesn't look like a vcf file
return 0;
} else {
try {
$vcard = VObject\Reader::read($parts[0]);
} catch (VObject\ParseException $e) {
// error while parsing, doesn't look like a vcard
return 0;
}
$toTranslate=1;
foreach ($vcard->children() as $vcardProperty) {
$importEntry = $this->getImportEntry($vcardProperty, $vcard);
if ($importEntry) {
$toTranslate++;
}
}
return (1 - pow(0.5, $toTranslate));
$element = $this->convertElementToVCard($parts[0]);
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
}
}