mirror of
https://github.com/avecms/AVE.cms.git
synced 2025-07-28 15:56:44 +00:00
Fixes
This commit is contained in:
@ -135,16 +135,17 @@
|
|||||||
$baseDir = str_replace('\\', '/', dirname(dirname(__FILE__)));
|
$baseDir = str_replace('\\', '/', dirname(dirname(__FILE__)));
|
||||||
|
|
||||||
//-- Если файл существует, показываем его
|
//-- Если файл существует, показываем его
|
||||||
if (file_exists($baseDir . $imagefile))
|
if (file_exists(BASE_DIR . $imagefile))
|
||||||
{
|
{
|
||||||
$img_data = @getimagesize($baseDir . $imagefile);
|
$img_data = @getimagesize(BASE_DIR . $imagefile);
|
||||||
|
|
||||||
header('max-age=315360000, public', true);
|
header('max-age=315360000, public', true);
|
||||||
header('Content-Type:' . $img_data['mime'], true);
|
header('Content-Type:' . $img_data['mime'], true);
|
||||||
|
header('Cache-Control: max-age=:315360000', true);
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + THUMBNAIL_CACHE_LIFETIME) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + THUMBNAIL_CACHE_LIFETIME) . " GMT");
|
||||||
header("Content-Length: " . (string) filesize($baseDir . $imagefile), true);
|
header("Content-Length: " . (string) filesize(BASE_DIR . $imagefile), true);
|
||||||
|
|
||||||
readfile($baseDir . $imagefile);
|
readfile(BASE_DIR . $imagefile);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -158,7 +159,7 @@
|
|||||||
// --
|
// --
|
||||||
if ($lenThumbDir && substr($thumbPath, -$lenThumbDir) != THUMBNAIL_DIR)
|
if ($lenThumbDir && substr($thumbPath, -$lenThumbDir) != THUMBNAIL_DIR)
|
||||||
{
|
{
|
||||||
if (! file_exists($baseDir . $imagefile))
|
if (! file_exists(BASE_DIR . $imagefile))
|
||||||
{
|
{
|
||||||
report404();
|
report404();
|
||||||
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
|
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
|
||||||
|
Reference in New Issue
Block a user