replace fopen/fread loop with readfile

This commit is contained in:
Andrew Dolgov 2013-03-31 09:54:52 +04:00
parent fc5cd15819
commit bf1fee8347
1 changed files with 1 additions and 8 deletions

View File

@ -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");