@@ -56,16 +56,16 @@ |
||
| 56 | 56 | $row->message = $message; |
| 57 | 57 | |
| 58 | 58 | try { |
| 59 | - if (!$user) { |
|
| 60 | - $reCaptcha = new ReCaptcha(Config::get('module.contact-us', 'secretKey')); |
|
| 61 | - $response = $reCaptcha->verify(Request::getParam('g-recaptcha-response'), $_SERVER['REMOTE_ADDR']); |
|
| 59 | + if (!$user) { |
|
| 60 | + $reCaptcha = new ReCaptcha(Config::get('module.contact-us', 'secretKey')); |
|
| 61 | + $response = $reCaptcha->verify(Request::getParam('g-recaptcha-response'), $_SERVER['REMOTE_ADDR']); |
|
| 62 | 62 | |
| 63 | - if (!$response->isSuccess()) { |
|
| 64 | - $exception = new ValidatorException(); |
|
| 65 | - $exception->setError('captcha', __('Invalid captcha')); |
|
| 66 | - throw $exception; |
|
| 67 | - } |
|
| 68 | - } |
|
| 63 | + if (!$response->isSuccess()) { |
|
| 64 | + $exception = new ValidatorException(); |
|
| 65 | + $exception->setError('captcha', __('Invalid captcha')); |
|
| 66 | + throw $exception; |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | 69 | $row->save(); |
| 70 | 70 | Messages::addSuccess('Message was successfully save'); |
| 71 | 71 | Response::reload(); |