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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user