Fix empty posts error
This commit is contained in:
parent
70a4c80143
commit
aec3b73730
@ -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 <br />
|
||||
for ($i=0; $i < count($posts); $i++) {
|
||||
$posts[$i]['content'] = preg_replace('/\r\n/', '<br />', $posts[$i]['content']);
|
||||
// Replace \n or \r with <br />
|
||||
for ($i=0; $i < count($posts); $i++) {
|
||||
$posts[$i]['content'] = preg_replace('/\r\n/', '<br />', $posts[$i]['content']);
|
||||
}
|
||||
}
|
||||
|
||||
View::render($url, [
|
||||
'posts' => $posts,
|
||||
'status' => $status
|
||||
]);
|
||||
die();
|
||||
}
|
||||
|
||||
public function entry()
|
||||
|
Loading…
Reference in New Issue
Block a user