diff --git a/app/Config/Honeypot.php b/app/Config/Honeypot.php index f4444a5d6c08..3810626dea11 100644 --- a/app/Config/Honeypot.php +++ b/app/Config/Honeypot.php @@ -11,6 +11,14 @@ class Honeypot extends BaseConfig * @var boolean */ public $hidden = true; + + /** + * Div wrapper of honeypot. + * + * @var string + */ + public $container = '
%s
'; + /** * Honeypot Label Content * diff --git a/system/Honeypot/Honeypot.php b/system/Honeypot/Honeypot.php index a8d908a0c976..4036dfe0ac71 100644 --- a/system/Honeypot/Honeypot.php +++ b/system/Honeypot/Honeypot.php @@ -72,6 +72,11 @@ function __construct(BaseConfig $config) { throw HoneypotException::forNoHiddenValue(); } + + if (empty($this->config->container) || strpos($this->config->container, '%s') === false) + { + $this->config->container = '
%s
'; + } if ($this->config->template === '') { @@ -124,7 +129,7 @@ protected function prepareTemplate(string $template): string if ($this->config->hidden) { - $template = '
' . $template . '
'; + $template = sprintf($this->config->container, $template); } return $template; }