Commit 9da8447b authored by Ben Hayward's avatar Ben Hayward

Added in method exists check

1 merge request!412[Sprint/SillySheep](fix): Failing spam detection on staging causing issues when uploading media #1193
Pipeline #100396271 canceled with stages
in 5 minutes and 30 seconds
......@@ -29,7 +29,9 @@ class Spam
$foundSpam = Text::strposa($entity->getBody(), ProhibitedDomains::DOMAINS);
break;
}
$foundSpam = Text::strposa($entity->getDescription(), ProhibitedDomains::DOMAINS);
if (method_exists($entity, 'getDescription')) {
$foundSpam = Text::strposa($entity->getDescription(), ProhibitedDomains::DOMAINS);
}
break;
case 'user':
$foundSpam = Text::strposa($entity->briefdescription, ProhibitedDomains::DOMAINS);
......
Please register or to comment