amic 8 meses atrás
pai
commit
bc0b9752e0
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      controllers/InquirerController.php

+ 1 - 1
controllers/InquirerController.php

@@ -28,6 +28,7 @@ class InquirerController extends \yii\web\Controller
         return $this->renderPartial("widget",["model"=>$model]);
     }
     public function actionAjax(){
+		$this->enableCsrfValidation = false;
 		if(\Yii::$app->request->isPost){
 			if(\Yii::$app->request->post('idq') && \Yii::$app->request->post('ask')  ){
 				$ida = (int) \Yii::$app->request->post('ask');	//ответ
@@ -44,7 +45,6 @@ class InquirerController extends \yii\web\Controller
 					$session->set('askq_'.$idq.'_'.$hash, time());
 
 					if( !$ret ){
-						$this->enableCsrfValidation = false;
 						$log->add($idq, $ida, $hash);
 						$answer = $model->getAnswer($idq, $ida);
 						$answer->count++;