Commit 4d950355 authored by Dries's avatar Dries
Browse files

- Patch #22118 by Robin Monks: made file_transfer() more robust.

parent 03250bd3
......@@ -442,11 +442,15 @@ function file_transfer($source, $headers) {
$source = file_create_path($source);
// Transfer file in 1024 byte chunks to save memory usage.
$fd = fopen($source, 'rb');
while (!feof($fd)) {
print fread($fd, 1024);
if ($fd = fopen($source, 'rb')) {
while (!feof($fd)) {
print fread($fd, 1024);
}
fclose($fd);
}
else {
drupal_not_found();
}
fclose($fd);
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