SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Spam

Helper for a simple mechanism to dissuade and annoy entry-level spammers.

For rigorous protection, use a CAPTCHA. @see Captcha

Functions

NameVisibilityDescription
censorpublic (static)Checks text for bad words, like 'tax' and 'capsicum'
checkpublic (static)Checks that the spam field was not submitted with the form
checkOrDiepublic (static)Checks that the spam field was not submitted with the form
detectpublic (static)Looks at a block of text to see if it looks like spam.
gluepublic (static)Generates a div containing an input which should never be filled in, in order to trap spam bots.

public censor

string Spam::censor ( string $text );

Checks text for bad words, like 'tax' and 'capsicum'

public check

boolean Spam::check ( );

Checks that the spam field was not submitted with the form

public checkOrDie

void Spam::checkOrDie ( );

Checks that the spam field was not submitted with the form

If the check fails the user will be redirected to the URL base ('/') along
with a notification. Normal users will never encounter this scenario.

public detect

array Spam::detect ( string $text );

Looks at a block of text to see if it looks like spam.

public glue

string Spam::glue ( );

Generates a div containing an input which should never be filled in, in order to trap spam bots.
To be used with Spam::check