diff --git a/public/include/pages/home.inc.php b/public/include/pages/home.inc.php index 2d0f5b23..ea4bd8fb 100644 --- a/public/include/pages/home.inc.php +++ b/public/include/pages/home.inc.php @@ -8,9 +8,11 @@ use \Michelf\Markdown; // Fetch active news to display $aNews = $news->getAllActive(); -foreach ($aNews as $key => $aData) { - // Transform Markdown content to HTML - $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); +if (is_array($aNews)) { + foreach ($aNews as $key => $aData) { + // Transform Markdown content to HTML + $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); + } } // Load news entries for Desktop site and unauthenticated users diff --git a/public/include/pages/news.inc.php b/public/include/pages/news.inc.php index 38e1022d..127b1775 100644 --- a/public/include/pages/news.inc.php +++ b/public/include/pages/news.inc.php @@ -8,9 +8,11 @@ use \Michelf\Markdown; // Fetch active news to display $aNews = $news->getAllActive(); -foreach ($aNews as $key => $aData) { - // Transform Markdown content to HTML - $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); +if (is_array($aNews)) { + foreach ($aNews as $key => $aData) { + // Transform Markdown content to HTML + $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); + } } // Tempalte specifics