Skip to content
Snippets Groups Projects
Commit 1104ec8f authored by nicolas lebozec's avatar nicolas lebozec
Browse files

FIX #19031 TIME 0:15 Fixed warnings when you want to download a complete folder

parent 034ed062
No related branches found
No related tags found
No related merge requests found
......@@ -552,7 +552,7 @@ class HistoryController
if (!empty($content['errors'])) {
return $response->withStatus(400)->withJson(['errors' => $content['errors']]);
}
$content = $content['fileContent'];
$content = $content['fileContent'] ?? null;
$format = 'zip';
$mimeType = 'application/zip';
......@@ -568,7 +568,7 @@ class HistoryController
if (empty($queryParams['mode']) || $queryParams['mode'] == 'base64') {
return $response->withJson(['encodedProofDocument' => base64_encode($content), 'format' => $format]);
} else {
$response->write($content);
$response->write($content ?? '');
$response = $response->withAddedHeader('Content-Disposition', "inline; filename=maarch_history_proof." . $format);
return $response->withHeader('Content-Type', $mimeType);
}
......@@ -581,6 +581,8 @@ class HistoryController
$tmpPath = CoreConfigModel::getTmpPath();
$zipFilename = $tmpPath . 'archivedProof' . $GLOBALS['id'] . '_' . rand() . '.zip';
if (empty($zipFilename))
if ($zip->open($zipFilename, \ZipArchive::CREATE) === true) {
foreach ($aArgs['documents'] as $document) {
if(file_exists($document['path']) && filesize($document['path']) > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment