[-] BO : fixed import images
This commit is contained in:
@@ -642,12 +642,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
if (is_null($separator) || trim($separator) == '')
|
if (is_null($separator) || trim($separator) == '')
|
||||||
$separator = ',';
|
$separator = ',';
|
||||||
|
|
||||||
do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid));
|
do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path));
|
||||||
$tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field);
|
file_put_contents($uniqid_path, $field);
|
||||||
$fd = fopen($temp, 'r');
|
$fd = fopen($uniqid_path, 'r');
|
||||||
$tab = fgetcsv($fd, MAX_LINE_SIZE, $separator);
|
$tab = fgetcsv($fd, MAX_LINE_SIZE, $separator);
|
||||||
fclose($fd);
|
fclose($fd);
|
||||||
unlink($tmp_file);
|
unlink($uniqid_path);
|
||||||
|
|
||||||
if (empty($tab) || (!is_array($tab)))
|
if (empty($tab) || (!is_array($tab)))
|
||||||
return array();
|
return array();
|
||||||
|
|||||||
Reference in New Issue
Block a user