diff options
| author | czaks <marcin@6irc.net> | 2013-08-18 13:16:31 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-18 13:16:31 -0400 |
| commit | da1b7d087e55019b064e4dff0498ae0aa8a64418 (patch) | |
| tree | cf92758fac657dee32485d34353653953b05b9a6 /post.php | |
| parent | f6c25382b9708eff88a575ba199a645fc3dac420 (diff) | |
| parent | f8837ad60cac5aa7ec1457819986822d14661681 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
install.php
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -595,8 +595,10 @@ if (isset($_POST['delete'])) { // not an image //copy($config['file_thumb'], $post['thumb']); $post['thumb'] = 'file'; - - $size = @getimagesize($config['file_thumb']); + + $size = @getimagesize(sprintf($config['file_thumb'], + isset($config['file_icons'][$post['extension']]) ? + $config['file_icons'][$post['extension']] : $config['file_icons']['default'])); $post['thumbwidth'] = $size[0]; $post['thumbheight'] = $size[1]; } @@ -605,7 +607,7 @@ if (isset($_POST['delete'])) { if (isset($post['file_tmp'])) { if (!@rename($upload, $post['file'])) error($config['error']['nomove']); - chmod($post['file'], 0755); + chmod($post['file'], 0644); } elseif (!@move_uploaded_file($upload, $post['file'])) error($config['error']['nomove']); } @@ -653,6 +655,7 @@ if (isset($_POST['delete'])) { // Remove board directories before inserting them into the database. if ($post['has_file']) { $post['file_path'] = $post['file']; + $post['thumb_path'] = $post['thumb']; $post['file'] = mb_substr($post['file'], mb_strlen($board['dir'] . $config['dir']['img'])); if ($is_an_image && $post['thumb'] != 'spoiler') $post['thumb'] = mb_substr($post['thumb'], mb_strlen($board['dir'] . $config['dir']['thumb'])); |
