diff options
| author | 8chan <admin@8chan.co> | 2015-04-20 04:20:17 -0700 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-05-05 13:21:09 +0200 |
| commit | 6b04b3c671fdcaa85be97c14336219217b193cc5 (patch) | |
| tree | f89c72fe6c9390c239085e8d89e802fd6f053f90 /inc/functions.php | |
| parent | 5f10badee90cadee42e051a10dbefb2a54045d5d (diff) | |
Fix post deletion
Diffstat (limited to 'inc/functions.php')
| -rwxr-xr-x | inc/functions.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php index c50336ae..c46807bb 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1130,6 +1130,8 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) { $files = json_decode($post['files']); $file_to_delete = $file !== false ? $files[(int)$file] : (object)array('file' => false); + if (!$files[0]) error(_('That post has no files.')); + if ($files[0]->file == 'deleted' && $post['num_files'] == 1 && !$post['thread']) return; // Can't delete OP's image completely. |
