1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-28 12:10:52 +02:00

image.php: replace file_get_contents() with a fread/print loop

This commit is contained in:
Andrew Dolgov 2013-03-31 09:49:36 +04:00
parent 55bd5dec80
commit 2f6ee35483

View File

@ -30,7 +30,16 @@
header("Content-type: image/png");
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)). " GMT";
header("Last-Modified: $stamp", true);
echo file_get_contents($filename);
$fp = fopen($filename, "r");
if ($fp) {
while ($data = fread($fp, 32768)) {
print $data;
}
fclose($fp);
}
} else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
echo "File not found.";