diff --git a/RestControllers/commentsController.php b/RestControllers/commentsController.php index ca28cb8..2ac54f4 100644 --- a/RestControllers/commentsController.php +++ b/RestControllers/commentsController.php @@ -188,7 +188,7 @@ class commentsController { $data["userID"] = $comment->get_userID(); $data["postID"] = $comment->get_postID(); $data["time_sent"] = $comment->get_time_sent(); - $data["content"] = $comment->get_content(); + $data["content"] = $comment->has_content() ? $comment->get_content() : ""; $data["img_path"] = $comment->has_img_path() ? $comment->get_img_path() : null; $data["img_url"] = $comment->has_img_url() ? $comment->get_img_url() : null; diff --git a/classes/components/comments.php b/classes/components/comments.php index b9456ed..993acbb 100644 --- a/classes/components/comments.php +++ b/classes/components/comments.php @@ -290,7 +290,7 @@ class Comments { //Check for image if($data["image_commentaire"] != ""){ $comment->set_img_path(str_replace("file:", "", $data["image_commentaire"])); - $info->set_img_url(path_user_data($info->get_img_path(), false)); + $comment->set_img_url(path_user_data($comment->get_img_path(), false)); } if($load_likes){