Huge bug: undoImage() was not working at all. This means lots of Tinyboard users probably have lone/permanent images. Working on Tinyboard-Tools script to remove all images/thumbs that don't belong.
This commit is contained in:
parent
844a337e03
commit
154fbf5070
@ -1859,10 +1859,10 @@ function undoImage(array $post) {
|
|||||||
if (!$post['has_file'])
|
if (!$post['has_file'])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (isset($post['file']))
|
if (isset($post['file_path']))
|
||||||
file_unlink($post['file']);
|
file_unlink($post['file_path']);
|
||||||
if (isset($post['thumb']))
|
if (isset($post['thumb_path']))
|
||||||
file_unlink($post['thumb']);
|
file_unlink($post['thumb_path']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function rDNS($ip_addr) {
|
function rDNS($ip_addr) {
|
||||||
|
1
post.php
1
post.php
@ -653,6 +653,7 @@ if (isset($_POST['delete'])) {
|
|||||||
// Remove board directories before inserting them into the database.
|
// Remove board directories before inserting them into the database.
|
||||||
if ($post['has_file']) {
|
if ($post['has_file']) {
|
||||||
$post['file_path'] = $post['file'];
|
$post['file_path'] = $post['file'];
|
||||||
|
$post['thumb_path'] = $post['thumb'];
|
||||||
$post['file'] = mb_substr($post['file'], mb_strlen($board['dir'] . $config['dir']['img']));
|
$post['file'] = mb_substr($post['file'], mb_strlen($board['dir'] . $config['dir']['img']));
|
||||||
if ($is_an_image && $post['thumb'] != 'spoiler')
|
if ($is_an_image && $post['thumb'] != 'spoiler')
|
||||||
$post['thumb'] = mb_substr($post['thumb'], mb_strlen($board['dir'] . $config['dir']['thumb']));
|
$post['thumb'] = mb_substr($post['thumb'], mb_strlen($board['dir'] . $config['dir']['thumb']));
|
||||||
|
Loading…
Reference in New Issue
Block a user