diff --git a/modules/core/src/Controller/ErrorReport.php b/modules/core/src/Controller/ErrorReport.php index 1ff5ee0243..c8bf5edceb 100644 --- a/modules/core/src/Controller/ErrorReport.php +++ b/modules/core/src/Controller/ErrorReport.php @@ -86,7 +86,10 @@ public function main(Request $request): RedirectResponse|Template $data['hostname'] = php_uname('n'); $data['directory'] = dirname(__FILE__, 2); - if ($this->config->getOptionalBoolean('errorreporting', true)) { + if(!empty($_REQUEST['name'])) { + // spam protection honeypot + Logger::debug('Ignoring error report from ' . $email . ': ' . preg_replace('/[\r\n]/', ' ', $text)); + } elseif ($this->config->getOptionalBoolean('errorreporting', true)) { $mail = new Utils\EMail('SimpleSAMLphp error report from ' . $email); $mail->setData($data); if (filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_REQUIRE_SCALAR)) { diff --git a/templates/error.twig b/templates/error.twig index 041139615e..7f7c12feda 100644 --- a/templates/error.twig +++ b/templates/error.twig @@ -42,7 +42,10 @@

{{ 'Optionally enter your email address, for the administrators to be able contact you for further questions about your issue:' | trans }}

- + + + {# spam protection honeypot #} +