mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +03:00
Missed two iSpamScore to be int instead of float
This commit is contained in:
parent
35433ca5b0
commit
adf1086c03
1 changed files with 2 additions and 2 deletions
|
|
@ -455,14 +455,14 @@ class Message implements \JsonSerializable
|
|||
$this->sSpamResult = $spam;
|
||||
$this->bIsSpam = !!\preg_match('/yes|spam/', $spam);
|
||||
if (\preg_match('/spamicity=([\\d\\.]+)/', $spam, $spamicity)) {
|
||||
$this->iSpamScore = \max(0, \min(100, \floatval($spamicity[1])));
|
||||
$this->iSpamScore = \intval(\max(0, \min(100, \floatval($spamicity[1]))));
|
||||
}
|
||||
} else if ($spam = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_SPAM_STATUS)) {
|
||||
$this->sSpamResult = $spam;
|
||||
if (\preg_match('/(?:hits|score)=([\\d\\.-]+)/', $spam, $value)
|
||||
&& \preg_match('/required=([\\d\\.-]+)/', $spam, $required)) {
|
||||
if ($threshold = \floatval($required[1])) {
|
||||
$this->iSpamScore = \max(0, \min(100, 100 * \floatval($value[1]) / $threshold));
|
||||
$this->iSpamScore = \intval(\max(0, \min(100, 100 * \floatval($value[1]) / $threshold)));
|
||||
$this->sSpamResult = "{$value[1]} / {$required[1]}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue