Browse Source

Fixes #884.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
9836b28ed3
  1. 3
      framework/yii/base/View.php

3
framework/yii/base/View.php

@ -12,7 +12,6 @@ use yii\helpers\FileHelper;
use yii\helpers\Html;
use yii\web\JqueryAsset;
use yii\web\AssetBundle;
use yii\web\Request;
use yii\widgets\Block;
use yii\widgets\ContentDecorator;
use yii\widgets\FragmentCache;
@ -711,7 +710,7 @@ class View extends Component
}
$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-token', 'content' => $request->getCsrfToken()));
}

Loading…
Cancel
Save