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']) {
|
if ($config['redraw_image']) {
|
||||||
$image->to($post['file']);
|
$image->to($post['file']);
|
||||||
} else {
|
} else {
|
||||||
if (!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file']))
|
$dont_copy_file = true;
|
||||||
error($config['error']['nomove']);
|
|
||||||
}
|
}
|
||||||
$image->destroy();
|
$image->destroy();
|
||||||
} else {
|
} else {
|
||||||
// not an image
|
// not an image
|
||||||
|
|
||||||
//copy($config['file_thumb'], $post['thumb']);
|
//copy($config['file_thumb'], $post['thumb']);
|
||||||
$post['thumb'] = 'file';
|
$post['thumb'] = 'file';
|
||||||
|
|
||||||
@ -483,6 +481,11 @@ if (isset($_POST['delete'])) {
|
|||||||
$post['thumbwidth'] = $size[0];
|
$post['thumbwidth'] = $size[0];
|
||||||
$post['thumbheight'] = $size[1];
|
$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'])) {
|
if ($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user