mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 23:09:10 +08:00
Bug #9670: Fixed PJAX redirect in IE
This commit is contained in:
@@ -23,6 +23,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #9583: Server response on invalid JSON request included a wrong message about "Internal Server Error" with status 500 (cebe)
|
||||
- Bug #9591: Fixed `yii.validation.js` code so it is compressable by YUICompressor (samdark, hofrob)
|
||||
- Bug #9596: Fixed `\yii\web\UrlManager::createAbsoluteUrl(['site/index', '#' => 'testHash'])` losing hash (alchimik, samdark)
|
||||
- Bug #9670: Fixed PJAX redirect in IE. `yii\web\Response::redirect()` - added check for `X-Ie-Redirect-Compatibility` header (silverfire)
|
||||
- Bug #9678: `I18N::format()` wasn't able to handle named placeholder in "selectordinal" (samdark)
|
||||
- Bug #9681: `Json::encode()` was erroring under CYGWIN (samdark)
|
||||
- Bug #9689: Hidden input on `Html::activeFileInput()` had the wrong name if a name was explicitly given (graphcon, cebe)
|
||||
|
||||
@@ -745,6 +745,7 @@ class Response extends \yii\base\Response
|
||||
* meaning if the current request is an AJAX or PJAX request, then calling this method will cause the browser
|
||||
* to redirect to the given URL. If this is false, a `Location` header will be sent, which when received as
|
||||
* an AJAX/PJAX response, may NOT cause browser redirection.
|
||||
* Takes effect only when request header `X-Ie-Redirect-Compatibility` is absent.
|
||||
* @return $this the response object itself
|
||||
*/
|
||||
public function redirect($url, $statusCode = 302, $checkAjax = true)
|
||||
@@ -758,7 +759,7 @@ class Response extends \yii\base\Response
|
||||
$url = Yii::$app->getRequest()->getHostInfo() . $url;
|
||||
}
|
||||
|
||||
if ($checkAjax) {
|
||||
if ($checkAjax && Yii::$app->getRequest()->getHeaders()->get('X-Ie-Redirect-Compatibility') !== null) {
|
||||
if (Yii::$app->getRequest()->getIsPjax()) {
|
||||
$this->getHeaders()->set('X-Pjax-Url', $url);
|
||||
} elseif (Yii::$app->getRequest()->getIsAjax()) {
|
||||
|
||||
Reference in New Issue
Block a user