1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-11 23:54:06 +02:00

Flextype Core: Entries - method fetch() - improvements.

This commit is contained in:
Awilum
2019-02-13 18:46:32 +03:00
parent 8b77295494
commit d5b028e214

View File

@@ -293,8 +293,13 @@ class Entries
$entry_file = PATH['entries'] . '/' . $entry . '/entry.html';
if (Filesystem::has($entry_file)) {
if ($entry = Filesystem::read($entry_file)) {
if ($entry_decoded = YamlParser::decode($entry)) {
if ($entry_body = Filesystem::read($entry_file)) {
if ($entry_decoded = YamlParser::decode($entry_body)) {
// Create default entry items
$entry_decoded['date'] = $entry_decoded['date'] ?? date(Registry::get('settings.date_format'), Filesystem::getTimestamp($entry_file));
$entry_decoded['slug'] = $entry_decoded['slug'] ?? $entry;
return $entry_decoded;
} else {
return false;