mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Fixes #1965: Controller::findLayoutFile()
returns incorrect file path when layout name starts with a slash
This commit is contained in:
@ -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 #1870: Validation errors weren't properly translated when using clientside validation (samdark)
|
||||
- Bug #1937: Fixed wrong behavior or advanced app's `init --env` when called without parameter actually specified (samdark)
|
||||
- Bug #1965: `Controller::findLayoutFile()` returns incorrect file path when layout name starts with a slash (qiangxue)
|
||||
- Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark)
|
||||
- Bug: Fixed incorrect event name for `yii\jui\Spinner` (samdark)
|
||||
- Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
|
||||
|
@ -400,7 +400,7 @@ class Controller extends Component implements ViewContextInterface
|
||||
if (strncmp($layout, '@', 1) === 0) {
|
||||
$file = Yii::getAlias($layout);
|
||||
} elseif (strncmp($layout, '/', 1) === 0) {
|
||||
$file = Yii::$app->getLayoutPath() . DIRECTORY_SEPARATOR . $layout;
|
||||
$file = Yii::$app->getLayoutPath() . DIRECTORY_SEPARATOR . substr($layout, 1);
|
||||
} else {
|
||||
$file = $module->getLayoutPath() . DIRECTORY_SEPARATOR . $layout;
|
||||
}
|
||||
|
Reference in New Issue
Block a user