From c11fb706a151f337bb883db07516fa1b36abe931 Mon Sep 17 00:00:00 2001 From: "M@d D3n" Date: Fri, 10 Jul 2020 12:14:35 +0300 Subject: [PATCH] Fixes --- inc/thumb.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/thumb.php b/inc/thumb.php index b09c3fc..3f4ba3a 100644 --- a/inc/thumb.php +++ b/inc/thumb.php @@ -135,16 +135,17 @@ $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('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("Content-Length: " . (string) filesize($baseDir . $imagefile), true); + header("Content-Length: " . (string) filesize(BASE_DIR . $imagefile), true); - readfile($baseDir . $imagefile); + readfile(BASE_DIR . $imagefile); exit; } @@ -158,7 +159,7 @@ // -- if ($lenThumbDir && substr($thumbPath, -$lenThumbDir) != THUMBNAIL_DIR) { - if (! file_exists($baseDir . $imagefile)) + if (! file_exists(BASE_DIR . $imagefile)) { report404(); header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');