From c170bc7ef2414f7bab809d91800d7d29cf58ab8e Mon Sep 17 00:00:00 2001 From: 370chan <108949465+370chan@users.noreply.github.com> Date: Sat, 20 Aug 2022 19:24:46 +0300 Subject: [PATCH] Fix files not being saved in certain cases (#483) --- post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 9db60af8..2748ac6e 100644 --- a/post.php +++ b/post.php @@ -966,6 +966,8 @@ if (isset($_POST['delete'])) { $thumb->_destroy(); } + + $dont_copy_file = false; if ($config['redraw_image'] || (!@$file['exif_stripped'] && $config['strip_exif'] && ($file['extension'] == 'jpg' || $file['extension'] == 'jpeg'))) { if (!$config['redraw_image'] && $config['use_exiftool']) { @@ -988,6 +990,7 @@ if (isset($_POST['delete'])) { $config['file_icons'][$file['extension']] : $config['file_icons']['default'])); $file['thumbwidth'] = $size[0]; $file['thumbheight'] = $size[1]; + $dont_copy_file = false; } if ($config['tesseract_ocr'] && $file['thumb'] != 'file') { // Let's OCR it! @@ -1018,7 +1021,7 @@ if (isset($_POST['delete'])) { } } - if (!isset($dont_copy_file) || !$dont_copy_file) { + if (!$dont_copy_file) { if (isset($file['file_tmp'])) { if (!@rename($file['tmp_name'], $file['file'])) error($config['error']['nomove']);