SproutCMS

This is the code documentation for the SproutCMS project

class Spam

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

For rigorous protection, use a CAPTCHA. @see Captcha

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-15
**/
class NewClassName extends Spam {
    
    /**
    * Checks text for bad words, like 'tax' and 'capsicum'
    **/
    public function censor (string $text) {
        // Method code goes here
    }
    
    /**
    * Looks at a block of text to see if it looks like spam.
    **/
    public function detect (string $text) {
        // Method code goes here
    }
    
    /**
    * Generates a div containing an input which should never be filled in, in order to trap spam bots.
    * To be used with {@see Spam::check}
    **/
    public function glue () {
        // Method code goes here
    }
    
    /**
    * Checks that the spam field was not submitted with the form
    **/
    public function check () {
        // Method code goes here
    }
    
    /**
    * 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 function checkOrDie () {
        // Method code goes here
    }
    
}
?>