diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 6e15c37..2031a38 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -209,8 +209,14 @@ 'scenario' => Feedback::SCENARIO_CONTACT, ] ); - if ($model->load(Yii::$app->request->post()) && $model->save()) { + if ($model->load(Yii::$app->request->post())) { + if (!empty($model->reCaptcha && $model->reCaptcha !== null || $model->reCaptcha != '')) + return [ + 'success' => 'false', + 'error' => 'You don`t confirm Recaptcha. Unblock JS to this' + ]; + $model->save(); return [ 'success' => true, 'message' => \Yii::t('app', 'Заявка успешно отправлена'), -- libgit2 0.21.4