From 7883998a786f89b202124ef73e03d07696312b94 Mon Sep 17 00:00:00 2001 From: Thalis Date: Fri, 28 Jul 2017 21:01:12 +0200 Subject: [PATCH 1/4] should fix moving a spoilered thread (OP) image --- inc/mod/pages.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index e51bbd7d..578752ab 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1356,6 +1356,7 @@ function mod_move($originBoard, $postID) { // copy image foreach ($post['files'] as $i => &$file) { $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); + if ($file['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); } } From 0b84fc26d691d90425787d126947303d4b9add91 Mon Sep 17 00:00:00 2001 From: Thalis Date: Fri, 28 Jul 2017 21:40:06 +0200 Subject: [PATCH 2/4] fixed deleted.png image not found on the front end --- templates/post/fileinfo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/post/fileinfo.html b/templates/post/fileinfo.html index 4a3300a4..80ddd2a6 100644 --- a/templates/post/fileinfo.html +++ b/templates/post/fileinfo.html @@ -5,7 +5,7 @@ {% for file in post.files %}
{% if file.file == 'deleted' %} - + {% else %}

File: {{ file.file }} ( From 0846d0c784c9d39ad69478d1292236924a3d096b Mon Sep 17 00:00:00 2001 From: Thalis Date: Fri, 28 Jul 2017 22:41:20 +0200 Subject: [PATCH 3/4] might fix moving replies with deleted image brace yourself for other conflicts lol --- inc/mod/pages.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 578752ab..b547f3cf 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1185,9 +1185,10 @@ function mod_move_reply($originBoard, $postID) { if ($post['has_file']) { foreach ($post['files'] as $i => &$file) { // move the image + if (isset($file['thumb'])) + if ($file['thumb'] != 'spoiler' || $file['thumb'] != 'deleted') { //trying to move/copy the spoiler thumb raises an error rename($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); - if ($file['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error - rename($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); + rename($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); } } } @@ -1355,9 +1356,11 @@ function mod_move($originBoard, $postID) { if ($post['has_file']) { // copy image foreach ($post['files'] as $i => &$file) { - $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); - if ($file['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error - $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); + if (isset($file['thumb'])) + if ($file['thumb'] != 'spoiler' || $file['thumb'] != 'deleted') { //trying to move/copy the spoiler thumb raises an error + $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); + $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); + } } } // insert reply From 7529c83a00d2e1b8bd4a2058edca7e81a596f01a Mon Sep 17 00:00:00 2001 From: Thalis Date: Fri, 28 Jul 2017 22:51:59 +0200 Subject: [PATCH 4/4] added fix from @Circlepuller to mod_move_reply also thx @Cirlepuller --- inc/mod/pages.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index b547f3cf..bef4a398 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1167,6 +1167,7 @@ function mod_move_reply($originBoard, $postID) { $post['has_file'] = true; foreach ($post['files'] as $i => &$file) { $file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']; + if (isset($file['thumb'])) $file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']; } } else {