From bf1fee83471cc9efef9f8d3ade0cd00b84633cf1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 31 Mar 2013 09:54:52 +0400 Subject: [PATCH] replace fopen/fread loop with readfile --- image.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/image.php b/image.php index 60f2cc83..94cb8e81 100644 --- a/image.php +++ b/image.php @@ -31,14 +31,7 @@ $stamp = gmdate("D, d M Y H:i:s", filemtime($filename)). " GMT"; header("Last-Modified: $stamp", true); - $fp = fopen($filename, "r"); - - if ($fp) { - while ($data = fread($fp, 32768)) { - print $data; - } - fclose($fp); - } + readfile($filename); } else { header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); -- 2.39.5