From f9e8390451388356d5125903075a7b2f44f89a2b Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Wed, 18 Oct 2023 15:03:57 -0400 Subject: [PATCH] Fix a bug with reporting posts to spamnoticer - Posts that have deleted files were not able to be reported as spam. Add checks in the spamnoticer code when building the request. --- inc/spamnoticer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/spamnoticer.php b/inc/spamnoticer.php index e0df33b1..b3b2ccbc 100644 --- a/inc/spamnoticer.php +++ b/inc/spamnoticer.php @@ -153,6 +153,11 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice if (isset($post->files) && is_array($post->files)) { foreach ($post->files as $file) { $key = $file->file_id . '.' . $file->extension; + + if (!isset($form_info->files_info[$key])) { + continue; + } + $file_info = $form_info->files_info[$key]; $thumb_uri = $config['spam_noticer']['imageboard_root'] @@ -201,6 +206,11 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice if (isset($post->files) && is_array($post->files)) { foreach ($post->files as $file) { + $key = $file->file_id . '.' . $file->extension; + if (!isset($form_info->files_info[$key])) { + continue; + } + $filename = $board['dir'] . $config['dir']['img'] . $file->file; $multipart[] = array(