summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-06-21 16:41:39 -0400
committerczaks <marcin@6irc.net>2013-06-21 16:41:39 -0400
commit24a520485df30a85a68d02938256c4a8ac7af8e8 (patch)
tree8a93e590b715624cfa7e3812a413061fc252c1ab /post.php
parentc073967600124568609d10a400039f017ad9dcf8 (diff)
parent9b0c31daa68c7ab96bc25e09b70ffea77ba23590 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: templates/page.html
Diffstat (limited to 'post.php')
-rw-r--r--post.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/post.php b/post.php
index 06a6c65d..710bb178 100644
--- a/post.php
+++ b/post.php
@@ -310,13 +310,21 @@ if (isset($_POST['delete'])) {
}
}
- // Check if thread is locked
- // but allow mods to post
- if (!$post['op'] && !hasPermission($config['mod']['postinlocked'], $board['uri'])) {
- if ($thread['locked'])
+ if (!$post['op']) {
+ // Check if thread is locked
+ // but allow mods to post
+ if ($thread['locked'] && !hasPermission($config['mod']['postinlocked'], $board['uri']))
error($config['error']['locked']);
+
+ $numposts = numPosts($post['thread']);
+
+ if ($config['reply_hard_limit'] != 0 && $config['reply_hard_limit'] <= $numposts['replies'])
+ error($config['error']['reply_hard_limit']);
+
+ if ($post['has_file'] && $config['image_hard_limit'] != 0 && $config['image_hard_limit'] <= $numposts['images'])
+ error($config['error']['image_hard_limit']);
}
-
+
if ($post['has_file']) {
$size = $_FILES['file']['size'];
if ($size > $config['max_filesize'])
@@ -644,7 +652,7 @@ if (isset($_POST['delete'])) {
buildThread($post['op'] ? $id : $post['thread']);
- if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || numPosts($post['thread']) < $config['reply_limit'])) {
+ if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies']+1 < $config['reply_limit'])) {
bumpThread($post['thread']);
}