Merge branch 'master' into feature/timeline

This commit is contained in:
Björn Fromme
2025-03-18 20:32:53 +01:00
11 changed files with 192 additions and 14 deletions
+4 -1
View File
@@ -22,7 +22,9 @@ class Sanitizer
$filesystem = new Filesystem();
if (true === $backup) {
$filesystem->copy($inputFilepath, $inputFilepath.'.bak');
$parts = pathinfo($inputFilepath);
$backupFilename = sprintf('%s/%s.orig.%s', $parts['dirname'], $parts['filename'], $parts['extension']);
$filesystem->copy($inputFilepath, $backupFilename);
}
$tempFilename = sha1($inputFilepath);
@@ -57,6 +59,7 @@ class Sanitizer
'-dNOPAUSE',
'-dQUIET',
'-dBATCH',
'-dPreserveAnnots=false',
'-sDEVICE=pdfwrite',
'-dCompatibilityLevel=1.4',
'-sOutputFile='.$outputFilepath,
+4 -1
View File
@@ -141,7 +141,10 @@ class UploadHandler
$sanitizedFilepath = $this->sanitizer->sanitizeFile($filepath);
if ($filepath !== $sanitizedFilepath) {
$upload->setFilename(basename($sanitizedFilepath));
$upload
->setFilename(basename($sanitizedFilepath))
->setMimeType('application/pdf')
;
}
} catch (\InvalidArgumentException $e) {
}