mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Bugfix: non-image file uploading
This commit is contained in:
parent
d86875a3b9
commit
4c2066bc27
9
post.php
9
post.php
@ -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'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user