| @@ -442,15 +442,25 @@ | ||
| 442 | 442 | ); |
| 443 | 443 | |
| 444 | 444 | $success = (bool) ( $response['success'] ?? false ); |
| 445 | 445 | if ( $success ) { |
| 446 | - $data_key = Captcha_Model::TURNSTILE === $this->model->provider | |
| 447 | - ? 'data_turnstile' | |
| 448 | - : 'data_' . $this->model->active_type; | |
| 449 | - | |
| 450 | - $data = $this->model->{$data_key}; | |
| 451 | - $data['verified'] = true; | |
| 452 | - $this->model->{$data_key} = $data; | |
| 446 | + if ( Captcha_Model::TURNSTILE === $this->model->provider ) { | |
| 447 | + $data = $this->model->data_turnstile; | |
| 448 | + $data['verified'] = true; | |
| 449 | + $this->model->data_turnstile = $data; | |
| 450 | + } elseif ( 'v2_checkbox' === $this->model->active_type ) { | |
| 451 | + $data = $this->model->data_v2_checkbox; | |
| 452 | + $data['verified'] = true; | |
| 453 | + $this->model->data_v2_checkbox = $data; | |
| 454 | + } elseif ( 'v2_invisible' === $this->model->active_type ) { | |
| 455 | + $data = $this->model->data_v2_invisible; | |
| 456 | + $data['verified'] = true; | |
| 457 | + $this->model->data_v2_invisible = $data; | |
| 458 | + } elseif ( 'v3_recaptcha' === $this->model->active_type ) { | |
| 459 | + $data = $this->model->data_v3_recaptcha; | |
| 460 | + $data['verified'] = true; | |
| 461 | + $this->model->data_v3_recaptcha = $data; | |
| 462 | + } | |
| 453 | 463 | $this->model->save(); |
| 454 | 464 | } |
| 455 | 465 | |
| 456 | 466 | return new Response( |