summaryrefslogtreecommitdiff
path: root/image.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-31 09:49:36 +0400
committerAndrew Dolgov <[email protected]>2013-03-31 09:49:36 +0400
commit2f6ee35483a2cf7214e4cd06569a350fe6c2982c (patch)
treeff38aa7daa60f3f3b051d4fda12007ca6decc7d7 /image.php
parent55bd5dec8048f741b932725607b994cc4f2abd38 (diff)
image.php: replace file_get_contents() with a fread/print loop
Diffstat (limited to 'image.php')
-rw-r--r--image.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/image.php b/image.php
index 36da375aa..60f2cc839 100644
--- a/image.php
+++ b/image.php
@@ -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.";