Project

General

Profile

Bug #103481

Updated by Sascha Egerer about 2 months ago

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 `$acceptsEmptyValues = true;@ 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.

Back