summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7194467)
If the admin tries to download a big file, the file read can cause a
crash.
Fixes #174
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
header('Content-Disposition: attachment; filename="' .
$l['file_name'] . '"');
if (file_exists(VAR_FILES . $p . $l['md5'])) {
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);