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

Source code (4 results)

/sprout/Controllers/EmailShareController.php   Highlighted file source

Line 27: use Sprout\Helpers\Spam;
Line 132: Spam::checkOrDie();

/sprout/Helpers/Spam.php   Highlighted file source

Line 20: * Helper for a simple mechanism to dissuade and annoy entry-level spammers.
Line 24: class Spam
Line 28: * Generates a div containing an input which should never be filled in, in order to trap spam bots.
Line 29: * To be used with {@see Spam::check}
Line 36: $out .= ' <p>Leave the following field blank, it is an anti-spam field.</p>';
Line 43: * Checks that the spam field was not submitted with the form
Line 54: * Checks that the spam field was not submitted with the form
Line 65: Notification::error('Are you a spam bot?');
Line 107: * Looks at a block of text to see if it looks like spam.
Line 109: * @note Do not rely on this to provide rigorous protection against spam.
Line 110: * @param string $text The text to check for spam

/sprout/tests/spamHelperTest.php   Highlighted file source

Line 14: use Sprout\Helpers\Spam;
Line 20: class spamHelperTest extends PHPUnit_Framework_TestCase
Line 25: $html = Spam::glue();
Line 41: $this->assertEmpty(Spam::detect(''));
Line 42: $this->assertEmpty(Spam::detect('a'));
Line 43: $this->assertEmpty(Spam::detect('ê'));
Line 45: $this->assertArrayHasKey('html', Spam::detect('<b>'));
Line 46: $this->assertArrayHasKey('html', Spam::detect('<b>hello</b>'));
Line 47: $this->assertArrayHasKey('html', Spam::detect('<img>'));
Line 48: $this->assertArrayNotHasKey('html', Spam::detect('< b >'));
Line 50: $this->assertArrayHasKey('url', Spam::detect('http://www.example.com'));
Line 51: $this->assertArrayHasKey('url', Spam::detect('www.example.com'));
Line 52: $this->assertArrayNotHasKey('url', Spam::detect('http example com'));
Line 54: $this->assertArrayHasKey('email', Spam::detect('test@example.com'));
Line 55: $this->assertArrayHasKey('email', Spam::detect('test.test@example.com'));
Line 56: $this->assertArrayNotHasKey('email', Spam::detect('test @ test'));

/sprout/views/email_share_form.php   Highlighted file source

Line 21: use Sprout\Helpers\Spam;
Line 30: <?= Spam::glue(); ?>

A total of 31 lines in 4 files were found