diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-04-29 19:14:10 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-04-29 19:14:10 -0400 |
| commit | 53e33d414fcf85fb2bf4219279378c4a4d131a70 (patch) | |
| tree | 12cf716a36ce7dc5c1a3f669687da0ed7ae0c4ae /inc/mod | |
| parent | 2b3942d19d3997da183fc0ab9af5f201f5531af6 (diff) | |
Fix mod_move for multi image
Diffstat (limited to 'inc/mod')
| -rw-r--r-- | inc/mod/pages.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 6f7ba95e..7f5df393 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1096,13 +1096,13 @@ function mod_move_reply($originBoard, $postID) { $post['op'] = true; } - if ($post['file']) { + if ($post['files']) { + $post['files'] = json_decode($post['files'], TRUE); $post['has_file'] = true; - $post['width'] = &$post['filewidth']; - $post['height'] = &$post['fileheight']; - - $file_src = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']; - $file_thumb = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']; + foreach ($post['files'] as $i => &$file) { + $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']; + } } else { $post['has_file'] = false; } @@ -1117,10 +1117,12 @@ function mod_move_reply($originBoard, $postID) { $newID = post($post); if ($post['has_file']) { - // move the image - rename($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']); - 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']); + foreach ($post['files'] as $i => &$file) { + // move the image + 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']); + } } } |
