Commit 745e84fb authored by Jérôme Jutteau's avatar Jérôme Jutteau

[BUGFIX] Fix crash when admin downloads

If the admin tries to download a big file, the file read can cause a
crash.

Fixes #174Signed-off-by: Jérôme Jutteau's avatarJerome Jutteau <jerome@jutteau.fr>
parent 89d73ff8
Pipeline #30543129 passed with stage
in 2 minutes and 16 seconds
......@@ -256,7 +256,12 @@ if (php_sapi_name() == "cli") {
header('Content-Disposition: attachment; filename="' .
$l['file_name'] . '"');
if (file_exists(VAR_FILES . $p . $l['md5'])) {
readfile(VAR_FILES . $p . $l['md5']);
$r = fopen(VAR_FILES . $p . $l['md5'], 'r');
while (!feof($r)) {
print fread($r, 1024);
ob_flush();
}
fclose($r);
}
exit;
}
......
Markdown is supported
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