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

Flextype Core: Entries - code fixes according Scrutinizer Tests.

This commit is contained in:
Awilum
2019-02-01 18:25:05 +03:00
parent f8077018ec
commit fbf726b45e

View File

@@ -312,6 +312,8 @@ class Entries
{
Http::setResponseStatus(404);
$entry = [];
$entry['title'] = Registry::get('settings.entries.error404.title');
$entry['description'] = Registry::get('settings.entries.error404.description');
$entry['content'] = Registry::get('settings.entries.error404.content');
@@ -334,7 +336,11 @@ class Entries
public static function processEntry(string $file_path, bool $raw = false, bool $ignore_content = false)
{
// Get entry from file
$entry = trim(Filesystem::read($file_path));
if ($entry_content = Filesystem::read($file_path)) {
$entry = $entry_content;
}
$entry = trim($entry);
// Return raw entry if $raw is true
if ($raw) {
@@ -346,9 +352,6 @@ class Entries
$entry_frontmatter = $entry['matter'];
$entry_content = $entry['body'];
// Create empty $_entry
$_entry = [];
// Process $entry_frontmatter with YAML and Shortcodes parsers
$_entry = YamlParser::decode(Shortcodes::process($entry_frontmatter));