fail gracefully on no thumbnail
This commit is contained in:
parent
8a46c7a0d5
commit
d2bb4a776f
@ -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
|
||||||
file_unlink($board['dir'] . $config['dir']['thumb'] . $f->thumb);
|
if (isset ($f->thumb) && $f->thumb) {
|
||||||
unset($files[$i]->thumb);
|
file_unlink($board['dir'] . $config['dir']['thumb'] . $f->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);
|
||||||
|
Loading…
Reference in New Issue
Block a user