From 72d9ef4dfa8230f35f91fadfd6a1e0a42aafce4e Mon Sep 17 00:00:00 2001 From: Pierre Date: Tue, 16 Jan 2018 18:36:41 +0100 Subject: [PATCH] Added security check for comments. --- RestControllers/postsController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RestControllers/postsController.php b/RestControllers/postsController.php index 74b18b5..bebb4b1 100644 --- a/RestControllers/postsController.php +++ b/RestControllers/postsController.php @@ -80,7 +80,11 @@ class postsController { $postID = getPostPostIDWithAccess("postID"); //Get informations about the post - $postInfos = components()->posts->get_single($postID, true); + $postInfos = components()->posts->get_single($postID, false); + + //Check if we can get the comments of the post + if(components()->user->allowComments($postInfos['user_page_id'])) + $postInfos['comments'] = components()->comments->get($postInfos["ID"]); //Check for errors if(count($postInfos) == 0)