Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Skip boolean values in blacklist string check #646

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
public function spamCheck(): bool
{
foreach ($this->mail->getAnswers() as $answer) {
if (is_array($answer->getValue())) {

Check failure on line 27 in Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php

View workflow job for this annotation

GitHub Actions / PHPstan

Ignored error pattern #^Cannot call method getValue\(\) on object\|null\.$# in path /home/runner/work/powermail/powermail/Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php is expected to occur 2 times, but occurred 3 times.
continue;
}
foreach ($this->getValues() as $blackword) {
if ($this->isStringInString($answer->getValue(), $blackword)) {
if (is_bool($answer->getValue())) {
continue;
}
if ($this->isStringInString((string)$answer->getValue(), $blackword)) {

Check failure on line 34 in Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php

View workflow job for this annotation

GitHub Actions / PHPstan

Cannot call method getValue() on object|null.
return true;
}
}
Expand Down
Loading