mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-16 07:11:19 +08:00
Update Controller.php
This commit is contained in:
@ -105,7 +105,7 @@ class Controller extends \yii\base\Controller
|
|||||||
public function beforeAction($action)
|
public function beforeAction($action)
|
||||||
{
|
{
|
||||||
if (parent::beforeAction($action)) {
|
if (parent::beforeAction($action)) {
|
||||||
if ($this->enableCsrfValidation && Yii::$app->errorHandler->exception === null && !Yii::$app->getRequest()->validateCsrfToken()) {
|
if ($this->enableCsrfValidation && Yii::$app->getErrorHandler()->exception === null && !Yii::$app->getRequest()->validateCsrfToken()) {
|
||||||
throw new BadRequestHttpException(Yii::t('yii', 'Unable to verify your data submission.'));
|
throw new BadRequestHttpException(Yii::t('yii', 'Unable to verify your data submission.'));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user