forked from GithubBackups/tinyib
Detect failure to create a thumbnail for non-video uploads
Resolves #205.
This commit is contained in:
parent
79adb305a3
commit
4e05d8512c
@ -842,6 +842,12 @@ function attachFile($post, $filepath, $filename, $uploaded) {
|
|||||||
$thumb_info = getimagesize('thumb/' . $post['thumb']);
|
$thumb_info = getimagesize('thumb/' . $post['thumb']);
|
||||||
$post['thumb_width'] = $thumb_info[0];
|
$post['thumb_width'] = $thumb_info[0];
|
||||||
$post['thumb_height'] = $thumb_info[1];
|
$post['thumb_height'] = $thumb_info[1];
|
||||||
|
|
||||||
|
if ($post['thumb_width'] <= 0 || $post['thumb_height'] <= 0) {
|
||||||
|
@unlink($file_location);
|
||||||
|
@unlink('thumb/' . $post['thumb']);
|
||||||
|
fancyDie(__('Sorry, your video appears to be corrupt.'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $post;
|
return $post;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user