diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index 70133a3..c0c8ddd 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -88,22 +88,22 @@ class Posts $status = 'admin'; } - if (array_key_exists(0, $post)) { - $posts = $post; - } else { - $posts[] = $post; - } + if ($post !== false) { + if (array_key_exists(0, $post)) { + $posts = $post; + } else { + $posts[] = $post; + } - // Replace \n or \r with
- for ($i=0; $i < count($posts); $i++) { - $posts[$i]['content'] = preg_replace('/\r\n/', '
', $posts[$i]['content']); + // Replace \n or \r with
+ for ($i=0; $i < count($posts); $i++) { + $posts[$i]['content'] = preg_replace('/\r\n/', '
', $posts[$i]['content']); + } } - View::render($url, [ 'posts' => $posts, 'status' => $status ]); - die(); } public function entry()