From cf5ed3d08a515fa7cf7de320b4f589df29eaf2ab Mon Sep 17 00:00:00 2001 From: RealAngeleno Date: Tue, 31 Oct 2023 22:03:09 -0700 Subject: [PATCH] logic for preventing deletion of old posts --- post.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/post.php b/post.php index 869fba42..48d016be 100644 --- a/post.php +++ b/post.php @@ -230,6 +230,10 @@ if (isset($_POST['delete'])) { $thread = $thread_query->fetch(PDO::FETCH_ASSOC); } + if ($post['time'] < time() - $config['max_delete_time'] && $config['max_delete_time'] != false) { + error(sprintf($config['error']['delete_too_late'], until($post['time'] + $config['max_delete_time']))); + } + if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password)) error($config['error']['invalidpassword']);