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