Added security check for comments.

This commit is contained in:
Pierre 2018-01-16 18:36:41 +01:00
parent ce593b5a5c
commit 72d9ef4dfa

View File

@ -80,7 +80,11 @@ class postsController {
$postID = getPostPostIDWithAccess("postID"); $postID = getPostPostIDWithAccess("postID");
//Get informations about the post //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 //Check for errors
if(count($postInfos) == 0) if(count($postInfos) == 0)