mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 01:14:34 +02:00
Fixed export of entities, if their name contained slash or other reserved charcters
This commit is contained in:
parent
2f17d5f3f5
commit
fb493cc837
2 changed files with 60 additions and 0 deletions
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
namespace App\Services\ImportExportSystem;
|
||||
|
||||
use App\Entity\Base\AbstractNamedDBElement;
|
||||
use App\Helpers\FilenameSanatizer;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use InvalidArgumentException;
|
||||
use function is_array;
|
||||
|
@ -166,6 +167,9 @@ class EntityExporter
|
|||
|
||||
$filename = 'export_'.$entity_name.'_'.$level.'.'.$format;
|
||||
|
||||
//Sanitize the filename
|
||||
$filename = FilenameSanatizer::sanitizeFilename($filename);
|
||||
|
||||
// Create the disposition of the file
|
||||
$disposition = $response->headers->makeDisposition(
|
||||
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue