Commit 3dead338 by Qiang Xue

CS fix.

parent 54368828
...@@ -292,12 +292,12 @@ class Request extends \yii\base\Request ...@@ -292,12 +292,12 @@ class Request extends \yii\base\Request
} }
/** /**
* Returns wheter this is a PJAX request * Returns whether this is a PJAX request
* @return boolean wether this is a PJAX request * @return boolean whether this is a PJAX request
*/ */
public function getIsPjax () public function getIsPjax ()
{ {
return $this->getIsAjax() && isset($_SERVER['HTTP_X_PJAX']) && $_SERVER['HTTP_X_PJAX']==true; return $this->getIsAjax() && !empty($_SERVER['HTTP_X_PJAX']);
} }
/** /**
......
...@@ -679,7 +679,7 @@ class Response extends \yii\base\Response ...@@ -679,7 +679,7 @@ class Response extends \yii\base\Response
} }
if (Yii::$app->getRequest()->getIsPjax()) { if (Yii::$app->getRequest()->getIsPjax()) {
$this->getHeaders()->set('X-PJAX-URL', $url); $this->getHeaders()->set('X-Pjax-Url', $url);
} elseif (Yii::$app->getRequest()->getIsAjax()) { } elseif (Yii::$app->getRequest()->getIsAjax()) {
$this->getHeaders()->set('X-Redirect', $url); $this->getHeaders()->set('X-Redirect', $url);
} else { } else {
......
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