Browse Source

Merge pull request #506 from rmrevin/master

Fix new method name "getIsAjax" and fix web application class name in logger
tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
6665a6b9eb
  1. 2
      framework/yii/logging/ProfileTarget.php
  2. 2
      framework/yii/web/Response.php
  3. 2
      framework/yii/web/User.php

2
framework/yii/logging/ProfileTarget.php

@ -70,7 +70,7 @@ class CProfileLogRoute extends CWebLogRoute
public function processLogs($logs)
{
$app = \Yii::$app;
if (!($app instanceof CWebApplication) || $app->getRequest()->getIsAjaxRequest())
if (!($app instanceof \yii\web\Application) || $app->getRequest()->getIsAjax())
return;
if ($this->getReport() === 'summary')

2
framework/yii/web/Response.php

@ -258,7 +258,7 @@ class Response extends \yii\base\Response
if (strpos($url, '/') === 0 && strpos($url, '//') !== 0) {
$url = Yii::$app->getRequest()->getHostInfo() . $url;
}
if (Yii::$app->getRequest()->getIsAjaxRequest()) {
if (Yii::$app->getRequest()->getIsAjax()) {
$statusCode = $this->ajaxRedirectCode;
}
header('Location: ' . $url, true, $statusCode);

2
framework/yii/web/User.php

@ -280,7 +280,7 @@ class User extends Component
public function loginRequired()
{
$request = Yii::$app->getRequest();
if (!$request->getIsAjaxRequest()) {
if (!$request->getIsAjax()) {
$this->setReturnUrl($request->getUrl());
}
if ($this->loginUrl !== null) {

Loading…
Cancel
Save