For detecting of spam-strings in posted values, this previous check did not work when a spam-value was at position 0 of the posted field (for example if the posted firstname field equals http://):
if (strpos($data[$field], $entry)) {
I changed the check to the following, which properly detects a spam-word if the posted value starts with that spam-word (spam-word is at position 0 of the posted value):
if (strpos($data[$field], $entry) !== false) {
php strpos documentation: Returns FALSE if the needle was not found.
For detecting of spam-strings in posted values, this previous check did not work when a spam-value was at position 0 of the posted field (for example if the posted firstname field equals http://):
if (strpos($data[$field], $entry)) {
I changed the check to the following, which properly detects a spam-word if the posted value starts with that spam-word (spam-word is at position 0 of the posted value):
if (strpos($data[$field], $entry) !== false) {
php strpos documentation: Returns FALSE if the needle was not found.