Project

General

Profile

Actions

Bug #103481

open

Honeypot / From EmptyValidator does not work at all ?!

Added by Sascha Egerer about 2 months ago. Updated 15 days ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2024-03-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I failed when I tried to test the "HoneyPot" function - as far as I can see it doesn't work.

The cause also seems pretty clear - but what surprises me is that this can never have worked before. The code, which was installed 11 years ago, somehow doesn't make sense - or i urgently need a vacation. To be honest, I can't imagine that this has never been noticed before.

As a test, I have also just sent 2 requests to https://typo3.org/contact and filled in the HoneyPot field. I would have expected the form not to be sent - but it was.

The cause is as follows:
The "EmptyValidator" has set $acceptsEmptyValues = true; - means it should be executed even if the value is empty, right?

This option is checked in

https://github.com/TYPO3/typo3/blob/e444d4492ec188d1ef996ae413a296e34850c4ec/typo3/sysext/extbase/Classes/Validation/Validator/AbstractValidator.php#L98. And

here is the error or not?

It says if ($this->acceptsEmptyValues === false || $this->isEmpty($value) === false) {. Shouldn't that be if ($this->acceptsEmptyValues === true || $this->isEmpty($value) === false) {, or am I stupid?

Because of the banality, I really can't imagine that this bug exists and hasn't been found yet. But there is also no UnitTest for it. I can gladly make a patch for it but I am still trying to believe that I am wrong.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #93435: Honeypot validation fails if no session data existsUnder Review2021-02-04

Actions
Actions

Also available in: Atom PDF