Add honeypot field for spambot

[MAILPOET-1014]
This commit is contained in:
Pavel Dohnal
2017-08-15 14:33:45 +02:00
parent f7b1016e63
commit 18f208cf47
5 changed files with 47 additions and 13 deletions

View File

@ -15,6 +15,7 @@ class Renderer {
$styles = new Util\Styles(static::getStyles($form));
$html = '<style type="text/css">';
$html .= '.mailpoet_hp_email_label{position: absolute;left: -999em;}';// move honeypot field out of the sight
$html .= $styles->render($prefix);
$html .= '</style>';
@ -38,7 +39,8 @@ class Renderer {
}
static function renderBlocks($blocks = array()) {
$html = '';
// this is a honeypot for spambots
$html = '<label class="mailpoet_hp_email_label">Please leave this field empty<input type="email" name="data[email]"></label>';
foreach($blocks as $key => $block) {
$html .= static::renderBlock($block)."\n";
}