From dd3b994a3cb906846d0405a95cc6aad64c002349 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Fri, 28 May 2021 20:13:30 -0700 Subject: [PATCH] Do not accept reports for approved posts Relates to #219. --- imgboard.php | 2 +- inc/database/flatfile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imgboard.php b/imgboard.php index ba65b0c..5c3b520 100644 --- a/imgboard.php +++ b/imgboard.php @@ -1057,7 +1057,7 @@ EOF; if ($_GET['approve'] > 0) { $post = postByID($_GET['approve']); if ($post) { - approvePostByID($post['id'], 1); + approvePostByID($post['id'], 2); $thread_id = $post['parent'] == TINYIB_NEWTHREAD ? $post['id'] : $post['parent']; if (strtolower($post['email']) != 'sage' && (TINYIB_MAXREPLIES == 0 || numRepliesToThreadByID($thread_id) <= TINYIB_MAXREPLIES)) { diff --git a/inc/database/flatfile.php b/inc/database/flatfile.php index 2a45d3f..663ba34 100644 --- a/inc/database/flatfile.php +++ b/inc/database/flatfile.php @@ -263,7 +263,7 @@ function approvePostByID($id, $moderated) { $rows = $GLOBALS['db']->selectWhere(POSTS_FILE, new SimpleWhereClause(POST_ID, '=', $id, INTEGER_COMPARISON), 1); if (count($rows) > 0) { foreach ($rows as $post) { - $post[POST_MODERATED] = $moderated; + $post[POST_MODERATED] = intval($moderated); $GLOBALS['db']->updateRowById(POSTS_FILE, POST_ID, $post); } }