mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Update Controller.php
This commit is contained in:
@ -105,7 +105,7 @@ class Controller extends \yii\base\Controller
|
||||
public function 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.'));
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user