Spamnoticer - addToSpamNoticer, guard against null files field

This commit is contained in:
towards-a-new-leftypol 2023-10-11 13:50:46 -04:00
parent e25908d87e
commit 18f63222f8
1 changed files with 22 additions and 20 deletions

View File

@ -150,6 +150,7 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice
$attachments = array(); $attachments = array();
if (isset($post->files) && is_array($post->files)) {
foreach ($post->files as $file) { foreach ($post->files as $file) {
$key = $file->file_id . '.' . $file->extension; $key = $file->file_id . '.' . $file->extension;
$file_info = $form_info->files_info[$key]; $file_info = $form_info->files_info[$key];
@ -174,6 +175,7 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice
$attachments[] = $a; $attachments[] = $a;
} }
}
$json_payload = [ $json_payload = [
'attachments' => $attachments, 'attachments' => $attachments,