Spamnoticer - more guards against null files field
This commit is contained in:
parent
18f63222f8
commit
505d62d872
|
@ -199,13 +199,15 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice
|
||||||
'contents' => json_encode($json_payload)
|
'contents' => json_encode($json_payload)
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($post->files as $file) {
|
if (isset($post->files) && is_array($post->files)) {
|
||||||
$filename = $board['dir'] . $config['dir']['img'] . $file->file;
|
foreach ($post->files as $file) {
|
||||||
|
$filename = $board['dir'] . $config['dir']['img'] . $file->file;
|
||||||
|
|
||||||
$multipart[] = array(
|
$multipart[] = array(
|
||||||
'name' => 'attachments',
|
'name' => 'attachments',
|
||||||
'contents' => GuzzleHttp\Psr7\Utils::tryFopen($filename, 'r')
|
'contents' => GuzzleHttp\Psr7\Utils::tryFopen($filename, 'r')
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue