mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: Division by zero #1694
This commit is contained in:
parent
166b790a3e
commit
c0ed491f7a
1 changed files with 4 additions and 2 deletions
|
|
@ -253,8 +253,10 @@ class Message implements \JsonSerializable
|
||||||
else if (\preg_match('@([\\d\\.]+)/([\\d\\.]+)@', $spam, $value)
|
else if (\preg_match('@([\\d\\.]+)/([\\d\\.]+)@', $spam, $value)
|
||||||
|| \preg_match('@([\\d\\.]+)/([\\d\\.]+)@', $oHeaders->ValueByName(MimeHeader::X_SPAM_INFO), $value)
|
|| \preg_match('@([\\d\\.]+)/([\\d\\.]+)@', $oHeaders->ValueByName(MimeHeader::X_SPAM_INFO), $value)
|
||||||
) {
|
) {
|
||||||
|
if ($threshold = \floatval($value[2])) {
|
||||||
|
$oMessage->setSpamScore(100 * \floatval($value[1]) / $threshold);
|
||||||
$oMessage->sSpamResult = "{$value[1]} / {$value[2]}";
|
$oMessage->sSpamResult = "{$value[1]} / {$value[2]}";
|
||||||
$oMessage->setSpamScore(100 * \floatval($value[1]) / \floatval($value[2]));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oMessage->bIsSpam = 'Yes' === \substr($spam, 0, 3)
|
$oMessage->bIsSpam = 'Yes' === \substr($spam, 0, 3)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue