1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-31 20:52:17 +01:00

Merge pull request #915 from owncloud/fix-standard-vcard-import

Fix standard vcard import
This commit is contained in:
Thomas Müller 2015-06-26 17:47:30 +02:00
commit b82e877b0b

View File

@ -125,7 +125,7 @@ class ImportController extends Controller {
$view->mkdir('imports');
}
$content = \OC_Filesystem::file_get_contents($path . '/' . $filename);
$content = \OC\Files\Filesystem::file_get_contents($path . '/' . $filename);
if($view->file_put_contents('/imports/' . $filename, $content)) {
$progresskey = 'contacts-import-' . rand();
$response->setParams(
@ -183,9 +183,9 @@ class ImportController extends Controller {
$file = $view->file_get_contents('/imports/' . $filename);
$importManager = new ImportManager();
$formatList = $importManager->getTypes();
$found = false;
$parts = array();
foreach ($formatList as $formatName => $formatDisplayName) {
@ -194,7 +194,7 @@ class ImportController extends Controller {
$found = true;
}
}
if (!$found) {
// detect file type
$mostLikelyName = "";
@ -206,13 +206,13 @@ class ImportController extends Controller {
$mostLikelyValue = $probValue;
}
}
if ($mostLikelyValue > 0) {
// found one (most likely...)
$parts = $importManager->importFile($view->getLocalFile('/imports/' . $filename), $mostLikelyName);
}
}
if ($parts) {
//import the contacts
$imported = 0;