public static function isSpam($content, $permaLink, $author = null, $email = null, $url = null, $type = 'comment')
{
// get some settings
$akismetKey = self::get('fork.settings')->get('Core', 'akismet_key');
// invalid key, so we can't detect spam
if ($akismetKey === '') {
return false;
}
// create new instance
$akismet = new Akismet($akismetKey, SITE_URL);
// set properties
$akismet->setTimeOut(10);
$akismet->setUserAgent('Fork CMS/' . FORK_VERSION);
// try it, to decide if the item is spam
try {
// check with Akismet if the item is spam
return $akismet->isSpam($content, $author, $email, $url, $permaLink, $type);
} catch (\Exception $e) {
// in debug mode we want to see exceptions, otherwise the fallback will be triggered
if (self::getContainer()->getParameter('kernel.debug')) {
throw $e;
}
// return unknown status
return 'unknown';
}
}