summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-05-06 21:53:38 +0200
committerczaks <marcin@6irc.net>2014-05-06 21:53:38 +0200
commitcd15458a324a5ce97a79f0dc6bb08bda9d38803d (patch)
treef8950a7204ffde367656c9d34594dba8296809f2 /post.php
parentd31a3539623640815628b626fd6428abed8a5b5c (diff)
parentf7278e5a61f2617ae4d99d83529c82df048cc0b1 (diff)
Merge remote-tracking branch 'origin/4.5'
Diffstat (limited to 'post.php')
-rw-r--r--post.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/post.php b/post.php
index 43d52674..ca6081f7 100644
--- a/post.php
+++ b/post.php
@@ -56,10 +56,19 @@ if (isset($_POST['delete'])) {
$query->execute() or error(db_error($query));
if ($post = $query->fetch(PDO::FETCH_ASSOC)) {
- if ($password != '' && $post['password'] != $password)
+ $thread = false;
+ if ($config['user_moderation'] && $post['thread']) {
+ $thread_query = prepare(sprintf("SELECT `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
+ $thread_query->bindValue(':id', $post['thread'], PDO::PARAM_INT);
+ $thread_query->execute() or error(db_error($query));
+
+ $thread = $thread_query->fetch(PDO::FETCH_ASSOC);
+ }
+
+ if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password))
error($config['error']['invalidpassword']);
- if ($post['time'] > time() - $config['delete_time']) {
+ if ($post['time'] > time() - $config['delete_time'] && (!$thread || $thread['password'] != $password)) {
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time'])));
}