chg: skip if email disabled, avoids logging exception on each email attempt fixes #9251

pull/9266/head
Luciano Righetti 2023-08-24 11:07:38 +02:00
parent eb12f89a2d
commit 225b74bf93
1 changed files with 4 additions and 0 deletions

View File

@ -845,6 +845,10 @@ class User extends AppModel
*/
public function sendEmail(array $user, $body, $bodyNoEnc = false, $subject, $replyToUser = false)
{
if (Configure::read('MISP.disable_emailing')) {
return true;
}
if ($user['User']['disabled'] || !$this->checkIfUserIsValid($user['User'])) {
return true;
}