fail gracefully on no thumbnail

This commit is contained in:
czaks 2016-05-17 09:53:09 +02:00
parent 8a46c7a0d5
commit d2bb4a776f

View File

@ -1161,8 +1161,10 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) {
foreach ($files as $i => $f) { foreach ($files as $i => $f) {
if (($file !== false && $i == $file) || $file === null) { if (($file !== false && $i == $file) || $file === null) {
// Delete thumbnail // Delete thumbnail
if (isset ($f->thumb) && $f->thumb) {
file_unlink($board['dir'] . $config['dir']['thumb'] . $f->thumb); file_unlink($board['dir'] . $config['dir']['thumb'] . $f->thumb);
unset($files[$i]->thumb); unset($files[$i]->thumb);
}
// Delete file // Delete file
file_unlink($board['dir'] . $config['dir']['img'] . $f->file); file_unlink($board['dir'] . $config['dir']['img'] . $f->file);