Hi all,
Im trying to make a custom hook to block spam links. I looked at the FormIt documentation but the snippet hook isn’t working. I’m not that familiair
with the syntax of MODx. So i basicaly started with trial and error.
But after a lot of go’s it still aint working. So I went to the forum, I hope someone here can help me out.
This is the snippet code where i’m working on:
<?php
$allFormFields = $hook->getValues();
if(preg_match('/(href=|\[url\]|\[url=|\[link=)/', $allFormFields))
{
$errorMsg = 'Forbidden to send links.';
$hook->addError('LinkSpam',$errorMsg);
return false;
}
else
{
return true;
}