Browse Source

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

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
462c50031a
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/web/Request.php
  3. 2
      framework/web/UrlManager.php
  4. 2
      framework/web/UrlRule.php

1
framework/CHANGELOG.md

@ -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)

2
framework/web/Request.php

@ -588,7 +588,7 @@ class Request extends \yii\base\Request
$pathInfo = substr($pathInfo, 1);
}
return $pathInfo;
return (string)$pathInfo;
}
/**

2
framework/web/UrlManager.php

@ -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);

2
framework/web/UrlRule.php

@ -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)) {

Loading…
Cancel
Save