]> git.wh0rd.org - tt-rss.git/commitdiff
image.php: replace file_get_contents() with a fread/print loop
authorAndrew Dolgov <fox@fakecake.org>
Sun, 31 Mar 2013 05:49:36 +0000 (09:49 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Sun, 31 Mar 2013 05:49:36 +0000 (09:49 +0400)
image.php

index 36da375aabbde9e4055027f2bb9ba3999b349649..60f2cc8397bad2f3ce47c09d2b1abc3b950a8a2e 100644 (file)
--- a/image.php
+++ b/image.php
                        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.";