diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-05-19 14:00:16 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-05-19 14:00:16 -0400 |
| commit | 65a14a0d39da375a08f4dfbb7225ee7906bb0601 (patch) | |
| tree | c8f6cec733143060cb0692d804589cc6bdcf3aa6 | |
| parent | 85136b76ed9f1e6d9f2185e02a05b7307215182b (diff) | |
Fix moving of deleted files
| -rw-r--r-- | inc/mod/pages.php | 7 |
1 files 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']); } } |
