mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-11 22:24:32 +01:00
fix bug with colon and space that made the import controller guess it's a ldif file instead of a vcard...
This commit is contained in:
parent
3664ccb597
commit
65bca0269f
@ -191,20 +191,9 @@ class ImportVCardConnector extends ImportConnector{
|
|||||||
// Doesn't look like a vcf file
|
// Doesn't look like a vcf file
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
try {
|
$element = $this->convertElementToVCard($parts[0]);
|
||||||
$vcard = VObject\Reader::read($parts[0]);
|
$unknownElements = $element->select("X-Unknown-Element");
|
||||||
} catch (VObject\ParseException $e) {
|
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||||
// 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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user