File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,16 @@ public function isValid($mail)
5353 /** @var Answer $answer */
5454 if ($ answer ->getField ()->getType () === 'captcha ' ) {
5555 $ this ->setCaptchaArgument (true );
56- if (!$ this ->validCodePreflight ($ answer ->getValue (), $ answer ->getField ())) {
57- $ this ->setErrorAndMessage ($ answer ->getField (), 'captcha ' );
56+ /* If the answer has a UID it has already been validated an persisted.
57+ * There's no reason to validate it twice. Also, there's no possibility, since the value to check
58+ * against got removed from the user's session on the first validation.
59+ * Resolves: https://github.com/einpraegsam/powermail/issues/376
60+ * Resolves: https://projekte.in2code.de/issues/44174
61+ */
62+ if (null === $ answer ->getUid ()) {
63+ if (!$ this ->validCodePreflight ($ answer ->getValue (), $ answer ->getField ())) {
64+ $ this ->setErrorAndMessage ($ answer ->getField (), 'captcha ' );
65+ }
5866 }
5967 }
6068 }
You can’t perform that action at this time.
0 commit comments