Skip to content

Commit

Permalink
use filesystem filter for import zip
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Nov 28, 2019
1 parent dd7493f commit af3da54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/ImportZip.php
Expand Up @@ -15,6 +15,7 @@
use Elabftw\Models\Database;
use Elabftw\Models\Experiments;
use Elabftw\Models\Users;
use Elabftw\Services\Filter;
use FilesystemIterator;
use PDO;
use RecursiveDirectoryIterator;
Expand Down Expand Up @@ -211,7 +212,7 @@ private function importAll(): void

// upload the attached files
if (is_array($item['uploads'])) {
$titlePath = preg_replace('/[^A-Za-z0-9 ]/', '_', $item['title']) ?? 'file';
$titlePath = Filter::forFilesystem($item['title']) ?? 'file';
foreach ($item['uploads'] as $file) {
if ($this->type === 'experiments') {
$filePath = $this->tmpPath . '/' .
Expand Down

0 comments on commit af3da54

Please sign in to comment.