Fix: UTF8 on import file name
This commit is contained in:
parent
a81271b8ca
commit
683c146d0c
@ -548,8 +548,7 @@ if ($step == 3 && $datatoimport)
|
||||
|
||||
// Search available imports
|
||||
$dir = $conf->import->dir_temp;
|
||||
$newdir=utf8_check($dir)?utf8_decode($dir):$dir; // opendir need ISO
|
||||
$handle=@opendir($newdir);
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
//print '<tr><td colspan="4">';
|
||||
@ -1399,14 +1398,14 @@ if ($step == 5 && $datatoimport)
|
||||
{
|
||||
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import&step=5&action=launchsimu'.$param.'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("CorrectErrorBeforeRunningImport")).'">'.$langs->trans("RunImportFile").'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("CorrectErrorBeforeRunningImport")).'">'.$langs->trans("RunImportFile").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("RunImportFile").'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("RunImportFile").'</a>';
|
||||
}
|
||||
print '</center>';
|
||||
}
|
||||
|
||||
@ -169,8 +169,7 @@ class ImportCsv extends ModeleImports
|
||||
|
||||
ini_set('auto_detect_line_endings',1); // For MAC compatibility
|
||||
|
||||
$newfile=utf8_check($file)?utf8_decode($file):$file; // fopen need ISO file name
|
||||
$this->handle = fopen($newfile, "r");
|
||||
$this->handle = fopen(dol_osencode($file), "r");
|
||||
if (! $this->handle)
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user