Browse Source

Detect failure to create a thumbnail for non-video uploads

Resolves #205.
shortcut
Trevor Slocum 1 year ago
parent
commit
4e05d8512c
  1. 6
      inc/functions.php

6
inc/functions.php

@ -842,6 +842,12 @@ function attachFile($post, $filepath, $filename, $uploaded) {
$thumb_info = getimagesize('thumb/' . $post['thumb']);
$post['thumb_width'] = $thumb_info[0];
$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;

Loading…
Cancel
Save