Commit d37c712f authored by Carsten  Rose's avatar Carsten Rose
Browse files

PDF/fileSplit: uploaded PDF file with missing extension '.pdf' have not been...

PDF/fileSplit: uploaded PDF file with missing extension '.pdf' have not been recognized as PDF files - fixed.
parent f4ba4b01
Pipeline #1742 passed with stage
in 2 minutes and 18 seconds
......@@ -937,8 +937,15 @@ class Save {
private function splitUpload(array $formElement, $pathFileName, $chmod, array $statusUpload) {
// Should the file be split and it's technically possible to split the file?
if (empty($formElement[FE_FILE_SPLIT]) || $statusUpload[FILES_TYPE] != MIME_TYPE_SPLIT_CAPABLE) {
// Should the file be split?
if (empty($formElement[FE_FILE_SPLIT])) {
return;
}
// Is it technically possible to split the file?
// BTW: the $statusUpload['type'] delivers 'octetstream' for PDF files who do not have the extension '.pdf' - therefore get mimetype again.
$mime = HelperFile::getMimeType($pathFileName);
if (false === strpos($mime, MIME_TYPE_SPLIT_CAPABLE) && $statusUpload[FILES_TYPE] != MIME_TYPE_SPLIT_CAPABLE) {
return;
}
......
Supports Markdown
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