From ce3214df1d6e14c1fd83cc181e7a5ac69743426c Mon Sep 17 00:00:00 2001 From: mistic100 Date: Fri, 30 Aug 2024 21:39:54 +0200 Subject: [PATCH] Fix check "activate_comments" config in WS --- include/ws_functions/pwg.images.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/ws_functions/pwg.images.php b/include/ws_functions/pwg.images.php index 9b760f225..45a4cdd68 100644 --- a/include/ws_functions/pwg.images.php +++ b/include/ws_functions/pwg.images.php @@ -301,6 +301,13 @@ function remove_chunks($original_sum, $type) */ function ws_images_addComment($params, $service) { + global $conf; + + if (!$conf['activate_comments']) + { + return new PwgError(403, 'Comments are disabled'); + } + $query = ' SELECT DISTINCT image_id FROM '. IMAGE_CATEGORY_TABLE .' @@ -511,7 +518,8 @@ SELECT id, date, author, content } $comment_post_data = null; - if ($is_commentable and + if ($conf['activate_comments'] and + $is_commentable and (!is_a_guest() or (is_a_guest() and $conf['comments_forall'] ) )