Commit 6665a6b9 by Qiang Xue

Merge pull request #506 from rmrevin/master

Fix new method name "getIsAjax" and fix web application class name in logger
parents bade6f7e 2239dd73
...@@ -70,7 +70,7 @@ class CProfileLogRoute extends CWebLogRoute ...@@ -70,7 +70,7 @@ class CProfileLogRoute extends CWebLogRoute
public function processLogs($logs) public function processLogs($logs)
{ {
$app = \Yii::$app; $app = \Yii::$app;
if (!($app instanceof CWebApplication) || $app->getRequest()->getIsAjaxRequest()) if (!($app instanceof \yii\web\Application) || $app->getRequest()->getIsAjax())
return; return;
if ($this->getReport() === 'summary') if ($this->getReport() === 'summary')
......
...@@ -258,7 +258,7 @@ class Response extends \yii\base\Response ...@@ -258,7 +258,7 @@ class Response extends \yii\base\Response
if (strpos($url, '/') === 0 && strpos($url, '//') !== 0) { if (strpos($url, '/') === 0 && strpos($url, '//') !== 0) {
$url = Yii::$app->getRequest()->getHostInfo() . $url; $url = Yii::$app->getRequest()->getHostInfo() . $url;
} }
if (Yii::$app->getRequest()->getIsAjaxRequest()) { if (Yii::$app->getRequest()->getIsAjax()) {
$statusCode = $this->ajaxRedirectCode; $statusCode = $this->ajaxRedirectCode;
} }
header('Location: ' . $url, true, $statusCode); header('Location: ' . $url, true, $statusCode);
......
...@@ -280,7 +280,7 @@ class User extends Component ...@@ -280,7 +280,7 @@ class User extends Component
public function loginRequired() public function loginRequired()
{ {
$request = Yii::$app->getRequest(); $request = Yii::$app->getRequest();
if (!$request->getIsAjaxRequest()) { if (!$request->getIsAjax()) {
$this->setReturnUrl($request->getUrl()); $this->setReturnUrl($request->getUrl());
} }
if ($this->loginUrl !== null) { if ($this->loginUrl !== null) {
......
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