From b476b660073adbe827836a7e7860b0fb3a061ff0 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 23 Aug 2015 09:04:37 +0800 Subject: [BUG] Image reject repost board option now also affects YT embeds --- post.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'post.php') 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); -- cgit v1.3