Commit 9836b28e by Qiang Xue

Fixes #884.

parent 2deff126
...@@ -12,7 +12,6 @@ use yii\helpers\FileHelper; ...@@ -12,7 +12,6 @@ use yii\helpers\FileHelper;
use yii\helpers\Html; use yii\helpers\Html;
use yii\web\JqueryAsset; use yii\web\JqueryAsset;
use yii\web\AssetBundle; use yii\web\AssetBundle;
use yii\web\Request;
use yii\widgets\Block; use yii\widgets\Block;
use yii\widgets\ContentDecorator; use yii\widgets\ContentDecorator;
use yii\widgets\FragmentCache; use yii\widgets\FragmentCache;
...@@ -711,7 +710,7 @@ class View extends Component ...@@ -711,7 +710,7 @@ class View extends Component
} }
$request = Yii::$app->getRequest(); $request = Yii::$app->getRequest();
if ($request instanceof Request && $request->enableCsrfValidation) { if ($request instanceof \yii\web\Request && $request->enableCsrfValidation) {
$lines[] = Html::tag('meta', '', array('name' => 'csrf-var', 'content' => $request->csrfVar)); $lines[] = Html::tag('meta', '', array('name' => 'csrf-var', 'content' => $request->csrfVar));
$lines[] = Html::tag('meta', '', array('name' => 'csrf-token', 'content' => $request->getCsrfToken())); $lines[] = Html::tag('meta', '', array('name' => 'csrf-token', 'content' => $request->getCsrfToken()));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment