summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/functions.php8
-rw-r--r--post.php1
2 files changed, 5 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 259245f3..d5348f0d 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1859,10 +1859,10 @@ function undoImage(array $post) {
if (!$post['has_file'])
return;
- if (isset($post['file']))
- file_unlink($post['file']);
- if (isset($post['thumb']))
- file_unlink($post['thumb']);
+ if (isset($post['file_path']))
+ file_unlink($post['file_path']);
+ if (isset($post['thumb_path']))
+ file_unlink($post['thumb_path']);
}
function rDNS($ip_addr) {
diff --git a/post.php b/post.php
index 572536de..d5e1c500 100644
--- a/post.php
+++ b/post.php
@@ -653,6 +653,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']));