mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
fix bug #807 that doesn't evaluates the return value of the function convertElementToVCard when detecting the file format
This commit is contained in:
parent
38c607e68c
commit
a5b717c76b
@ -234,8 +234,12 @@ class ImportCsvConnector extends ImportConnector {
|
||||
return 0;
|
||||
} else {
|
||||
$element = $this->convertElementToVCard($parts[0], $titles);
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
if ($element) {
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,8 +207,12 @@ class ImportLdifConnector extends ImportConnector{
|
||||
return 0;
|
||||
} else {
|
||||
$element = $this->convertElementToVCard($parts[0]);
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
if ($element) {
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,8 +199,12 @@ class ImportVCardConnector extends ImportConnector{
|
||||
return 0;
|
||||
} else {
|
||||
$element = $this->convertElementToVCard($parts[0]);
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
if ($element) {
|
||||
$unknownElements = $element->select("X-Unknown-Element");
|
||||
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user