summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'post.php')
-rw-r--r--post.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/post.php b/post.php
index 3b4f3311..06a9dc74 100644
--- a/post.php
+++ b/post.php
@@ -294,6 +294,32 @@ if (isset($_POST['delete'])) {
if (!isset($post['embed'])) {
error($config['error']['invalid_embed']);
}
+
+ if ($config['image_reject_repost']) {
+ if ($p = getPostByEmbed($post['embed'])) {
+ 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 = getPostByEmbedInThread($post['embed'], $post['thread'])) {
+ 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']['bypass_field_disable'], $board['uri'])) {
@@ -798,7 +824,7 @@ if (isset($_POST['delete'])) {
));
}
}
- }
+ }
if (!hasPermission($config['mod']['postunoriginal'], $board['uri']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) {
undoImage($post);