Commit 2a869a41 authored by Mikael Salson's avatar Mikael Salson
Browse files

FileImporter.php: Deal with folders whose names contain non-ASCII characters

Otherwise it fails the import
parent 3e8a6b7e
......@@ -143,6 +143,11 @@ class FileImporter extends ContainerAware {
while ($entry = readdir($files)) {
if ($entry != '.' && $entry != '..') {
if(is_dir($path.'/'.$entry)) {
if (! mb_detect_encoding($entry)) {
$new_entry = preg_replace('/[[:^print:]]/', '_', $entry);
rename($path.'/'.$entry, $path.'/'.$new_entry);
$entry = $new_entry;
}
$this->indexeDossier($dossier.'/'.$entry,$rendu);
}
else if (is_file($path.'/'.$entry)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment