diff options
author | Andrew Dolgov <[email protected]> | 2013-03-31 09:54:52 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-31 09:54:52 +0400 |
commit | bf1fee83471cc9efef9f8d3ade0cd00b84633cf1 (patch) | |
tree | 0a379bd7ab5f320474da86afea37829413f8ec77 | |
parent | fc5cd15819dfc603e137a24d85239a15ab6cb1ee (diff) |
replace fopen/fread loop with readfile
-rw-r--r-- | image.php | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -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"); |