Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use comment black list for anti-spam #3544

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Shelob9
Copy link
Collaborator

@Shelob9 Shelob9 commented May 28, 2020

#2880

What Has Changed

I created a new method in the Caldera_Forms class that gets the list of bad words from WordPress. It has a filter so end users can customize. I then copied logic from here https://gist.github.com/them-es/7c8a120ac868f5c4fc474e53a1266c83 to the loop where fields are validated.

How to test

I'm not sure yet. But I think adding words to the block list and submitting form with those words in the fields.

@Shelob9 Shelob9 requested a review from New0 May 28, 2020 19:24
@Shelob9 Shelob9 changed the title Use commnent black list for anti-spam Use comment black list for anti-spam May 28, 2020
@Zodiac1978
Copy link

This needs a refresh after WordPress 5.5
See: https://make.wordpress.org/core/2020/07/23/codebase-language-improvements-in-5-5/

It still works, but on WP 5.5 it would trigger a deprecated warning.

There should be something like this:

if ( false === get_option( 'disallowed_keys' ) ) {
    // Assume this is WP < 5.5. Option does not exist.
} else {
    // Assume this is WP >= 5.5
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants