1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

Bugfix: non-image file uploading

This commit is contained in:
Michael Save 2012-04-20 19:04:37 +10:00
parent d86875a3b9
commit 4c2066bc27

View File

@ -469,13 +469,11 @@ if (isset($_POST['delete'])) {
if ($config['redraw_image']) {
$image->to($post['file']);
} else {
if (!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file']))
error($config['error']['nomove']);
$dont_copy_file = true;
}
$image->destroy();
} else {
// not an image
//copy($config['file_thumb'], $post['thumb']);
$post['thumb'] = 'file';
@ -483,6 +481,11 @@ if (isset($_POST['delete'])) {
$post['thumbwidth'] = $size[0];
$post['thumbheight'] = $size[1];
}
if (!isset($dont_copy_file) || !$dont_copy_file) {
if (!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file']))
error($config['error']['nomove']);
}
}
if ($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {