1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-10 07:06:45 +02:00

Merge pull request #27 from alexantr/patch-1

Fixes #26 no 404 status if get page from cache
This commit is contained in:
Sergey Romanenko
2018-06-12 22:28:23 +03:00
committed by GitHub

View File

@@ -147,15 +147,15 @@ class Content
// Try to get page from cache
if (Cache::contains($page_cache_id)) {
if (!Filesystem::fileExists($file_path)) {
Http::setResponseStatus(404);
}
return Cache::fetch($page_cache_id);
} else {
// Get 404 page if page file is not exists
if (Filesystem::fileExists($file_path)) {
$file_path = $file_path;
} else {
if (!Filesystem::fileExists($file_path)) {
if (Filesystem::fileExists($file_path = PATH['pages'] . '/404/page.html')) {
$file_path = $file_path;
Http::setResponseStatus(404);
} else {
throw new \RuntimeException("404 page file does not exist.");