@ -5,6 +5,7 @@ Yii Framework 2 Change Log
------------------------
- Bug #18545: Reversed changes made to the `yii\db\Query::all()` and `indexBy` handling (bizley)
- Bug #18548: Fix bug with REST rules with prefixes containing tokens not being parsed properly (bizley)
2.0.41 March 03, 2021
@ -216,7 +216,11 @@ class UrlRule extends CompositeUrlRule
public function parseRequest($manager, $request)
{
$pathInfo = $request->getPathInfo();
if ($this->prefix !== '' && strpos($pathInfo . '/', $this->prefix . '/') !== 0) {
if (
$this->prefix !== ''
&& strpos($this->prefix, '<') === false
&& strpos($pathInfo . '/', $this->prefix . '/') !== 0
) {
return false;
}
@ -62,7 +62,6 @@ class UrlRuleTest extends TestCase
protected function getTestsForParseRequest()
// structure of each test
@ -162,6 +161,13 @@ class UrlRuleTest extends TestCase
['posts/1338', 'post/view', ['id' => 1338]],
],
[
'prefix with token',
['controller' => 'post', 'prefix' => 'admin/<name>'],
['admin/aaa/posts', 'post/index', ['name' => 'aaa']],
];