Quote from: Steeve at Oct 30, 2016, 03:37 AMThere is the error log you can find in Administration > Reports > Errors log.
You can put your code (your form, the Formit call, and your custom validator) here like this i can test on my own installation.
Steeve, guess who's back? I didn't take you up on your offer to test this on your own site because I wasn't comfortable providing some client-specific information in the form itself, like email addresses and field names.
Instead, I just tried something that tells me my snippet is never being called. The original snippet is called "filterNoreplyAddresses". It's content was:
<?php
/* reject email addresses containing noreply, donotreply */
$email = $value;
if (strpos($email, 'noreply') !== false || strpos($email, 'donotreply') !== false) {
return false;
}
else {
return true;
}
I then changed it to always return false as follows:
<?php
/* reject email addresses containing noreply, donotreply */
return false;
When the form still submitted successfully I assumed the snippet wasn't being called.
Basically I've got a working form and the only modifications/additions I made were:
Adding &customValidators=`filterNoreplyAddresses`
and
modifying
&validate=`nospam:blank,name:required,email:email:filterNoreplyAddresses:required`
Unless it's bad syntax to run 3 tests on the 'email' field or perhaps not running the validation snippet last instead of second, I'm stymied as to why it doesn't work.
If you were going to write a validator to reject an email address like "
[email protected]" would you have added any other code than I did? It seems so simple.
If any thought jumps to mind please advise me Steeve. Some defective human out there is getting his jollies submitting mailing requests with "noreply" as part of the address and he's been accelerating this "game" recently.
Thanks ... Sam
[ed. note: samg last edited this post 9 years, 10 months ago.]