Commit 462c5003 by Alexander Makarov

Fixes #1930: Fixed domain based URL matching for website root

parent 0c226154
......@@ -27,6 +27,7 @@ Yii Framework 2 Change Log
- Bug #1827: Debugger toolbar is loaded twice if an action is calling `run()` to execute another action (qiangxue)
- Bug #1869: Fixed tables clearing. `TRUNCATE` changed to `DELETE` to avoid postgresql tables checks (and truncating all tables) (Ragazzo)
- Bug #1870: Validation errors weren't properly translated when using clientside validation (samdark)
- Bug #1930: Fixed domain based URL matching for website root (samdark)
- Bug #1937: Fixed wrong behavior or advanced app's `init --env` when called without parameter actually specified (samdark)
- Bug #1959: `Html::activeCheckbox` wasn't respecting custom values for checked/unchecked state (klevron, samdark)
- Bug #1965: `Controller::findLayoutFile()` returns incorrect file path when layout name starts with a slash (qiangxue)
......
......@@ -588,7 +588,7 @@ class Request extends \yii\base\Request
$pathInfo = substr($pathInfo, 1);
}
return $pathInfo;
return (string)$pathInfo;
}
/**
......
......@@ -214,7 +214,7 @@ class UrlManager extends Component
}
}
return [(string)$pathInfo, []];
return [$pathInfo, []];
} else {
Yii::trace('Pretty URL not enabled. Using default URL parsing logic.', __METHOD__);
$route = $request->get($this->routeVar);
......
......@@ -217,7 +217,7 @@ class UrlRule extends Object
}
if ($this->host !== null) {
$pathInfo = strtolower($request->getHostInfo()) . '/' . $pathInfo;
$pathInfo = strtolower($request->getHostInfo()) . ($pathInfo === '' ? '' : '/' . $pathInfo);
}
if (!preg_match($this->pattern, $pathInfo, $matches)) {
......
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