summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'post.php')
-rw-r--r--post.php39
1 files changed, 28 insertions, 11 deletions
diff --git a/post.php b/post.php
index 1153b46a..98da7486 100644
--- a/post.php
+++ b/post.php
@@ -478,17 +478,34 @@ if (isset($_POST['delete'])) {
}
}
- if ($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {
- undoImage($post);
- error(sprintf($config['error']['fileexists'],
- $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
- $board['dir'] . $config['dir']['res'] .
- ($p['thread'] ?
- $p['thread'] . '.html#' . $p['id']
- :
- $p['id'] . '.html'
- )
- ));
+ if ($post['has_file']) {
+ if ($config['image_reject_repost']) {
+ if ($p = getPostByHash($post['filehash'])) {
+ undoImage($post);
+ error(sprintf($config['error']['fileexists'],
+ $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
+ $board['dir'] . $config['dir']['res'] .
+ ($p['thread'] ?
+ $p['thread'] . '.html#' . $p['id']
+ :
+ $p['id'] . '.html'
+ )
+ ));
+ }
+ } else if (!$post['op'] && $config['image_reject_repost_in_thread']) {
+ if ($p = getPostByHashInThread($post['filehash'], $post['thread'])) {
+ undoImage($post);
+ error(sprintf($config['error']['fileexistsinthread'],
+ $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
+ $board['dir'] . $config['dir']['res'] .
+ ($p['thread'] ?
+ $p['thread'] . '.html#' . $p['id']
+ :
+ $p['id'] . '.html'
+ )
+ ));
+ }
+ }
}
if (!hasPermission($config['mod']['postunoriginal'], $board['uri']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) {