From 65a14a0d39da375a08f4dfbb7225ee7906bb0601 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 14:00:16 -0400 Subject: [PATCH] Fix moving of deleted files --- inc/mod/pages.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 1452d109..03f00ef1 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1199,6 +1199,8 @@ function mod_move($originBoard, $postID) { $post['files'] = json_decode($post['files'], TRUE); $post['has_file'] = true; foreach ($post['files'] as $i => &$file) { + if ($file['file'] === 'deleted') + continue; $file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']; $file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']; } @@ -1218,8 +1220,9 @@ 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 (!in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) + if ($file['file'] !== 'deleted') + $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); + if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); } }