1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-25 16:00:22 +01:00

Critical bug: could not move threads/posts with spoiler images, resulted in I/O error

This commit is contained in:
ctrlcctrlv 2013-08-09 19:40:49 +00:00
parent dc943a91fc
commit ceb257a9bd

View File

@ -1054,7 +1054,9 @@ function mod_move_reply($originBoard, $postID) {
if ($post['has_file']) { if ($post['has_file']) {
// move the image // move the image
rename($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']); rename($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']);
rename($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']); if ($post['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error
rename($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']);
}
} }
buildIndex(); buildIndex();
@ -1146,7 +1148,9 @@ function mod_move($originBoard, $postID) {
if ($post['has_file']) { if ($post['has_file']) {
// copy image // copy image
$clone($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']); $clone($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']);
$clone($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']); if ($post['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error
$clone($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']);
}
} }
// go back to the original board to fetch replies // go back to the original board to fetch replies