Browse Source

Fix #17434: IE Ajax redirect fix for non 11.0 versions

tags/2.0.30
Somogyi Márton 5 years ago committed by Alexander Makarov
parent
commit
6c1b2db9de
  1. 2
      framework/CHANGELOG.md
  2. 2
      framework/web/Response.php
  3. 1
      tests/framework/web/ResponseTest.php

2
framework/CHANGELOG.md

@ -7,7 +7,7 @@ Yii Framework 2 Change Log
- Bug #17632: Unicode file name was not correctly parsed in multipart forms (AlexRas007, samdark) - Bug #17632: Unicode file name was not correctly parsed in multipart forms (AlexRas007, samdark)
- Bug #17648: Handle empty column arrays in console `Table` widget (alex-code) - Bug #17648: Handle empty column arrays in console `Table` widget (alex-code)
- Bug #17657: Fix migration errors from missing `$schema` in RBAC init file when using MSSQL (PoohOka) - Bug #17657: Fix migration errors from missing `$schema` in RBAC init file when using MSSQL (PoohOka)
- Bug #17434: IE Ajax redirect fix for non 11.0 versions (kamarton)
2.0.29 October 22, 2019 2.0.29 October 22, 2019
----------------------- -----------------------

2
framework/web/Response.php

@ -870,7 +870,7 @@ class Response extends \yii\base\Response
if ($checkAjax) { if ($checkAjax) {
if ($request->getIsAjax()) { if ($request->getIsAjax()) {
if (in_array($statusCode, [301, 302]) && preg_match('/Trident.*\brv:11\./' /* IE11 */, $request->userAgent)) { if (in_array($statusCode, [301, 302]) && preg_match('/Trident\/|MSIE[ ]/', $request->userAgent)) {
$statusCode = 200; $statusCode = 200;
} }
if ($request->getIsPjax()) { if ($request->getIsPjax()) {

1
tests/framework/web/ResponseTest.php

@ -176,6 +176,7 @@ class ResponseTest extends \yiiunit\TestCase
['Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko', [301 => 200, 302 => 200]], // IE 11 ['Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko', [301 => 200, 302 => 200]], // IE 11
['Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', [301 => 301, 302 => 302]], // Chrome ['Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', [301 => 301, 302 => 302]], // Chrome
['Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136', [301 => 301, 302 => 302]], // Edge ['Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136', [301 => 301, 302 => 302]], // Edge
['Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)', [301 => 200, 302 => 200]], // special windows versions (for tablets or IoT devices)
]; ];
} }

Loading…
Cancel
Save