File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Classes/Domain/Validator/SpamShield Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ class CaptchaMethod extends AbstractMethod
2828 */
2929 protected string $ captchaMethod = '' ;
3030
31+ /**
32+ * @var array|array[]
33+ */
3134 protected array $ captchaConfiguration = [
3235 'recaptcha ' => [
3336 'siteVerifyUri ' => 'https://www.google.com/recaptcha/api/siteverify ' ,
@@ -134,7 +137,7 @@ protected function verifyCaptchaResponse(): bool
134137
135138 $ result = \json_decode ($ jsonResult );
136139
137- return ( bool ) $ result -> success ;
140+ return $ this -> getExpextedResponseAttribute ( $ result ) ;
138141 }
139142
140143 /**
@@ -219,6 +222,22 @@ protected function getActionName(): string
219222 return $ pluginVariables ['action ' ] ?? '' ;
220223 }
221224
225+ /**
226+ * @param array|\stdClass $result
227+ *
228+ * @return bool
229+ */
230+ protected function getExpextedResponseAttribute (array |\stdClass $ result ): bool {
231+ if ($ this ->configuration ['captchaMethod ' ] === 'procaptcha ' ) {
232+ return $ result ->status === 'ok ' && $ result ->verified ;
233+ }
234+
235+ return (bool )$ result ->success ;
236+ }
237+
238+ /**
239+ * @return RequestInterface|null
240+ */
222241 protected function getRequest (): ?RequestInterface
223242 {
224243 return $ GLOBALS ['TYPO3_REQUEST ' ] ?? null ;
Original file line number Diff line number Diff line change 88 'author_email ' => 'thomas.rawiel@gmail.com ' ,
99 'state ' => 'stable ' ,
1010 'clearCacheOnLoad ' => 0 ,
11- 'version ' => '2.1.1 ' ,
11+ 'version ' => '2.1.2 ' ,
1212 'constraints ' => [
1313 'depends ' => [
1414 'typo3 ' => '12.4.0-12.4.99 ' ,
You can’t perform that action at this time.
0 commit comments