Fix #1034 redirect of page creation procedure when system.home.hide_in_urls is enabled

This commit is contained in:
Flavio Copes
2016-09-13 13:45:09 +02:00
parent 838dfe7a65
commit fd8c7889d1
2 changed files with 11 additions and 5 deletions

View File

@@ -1987,14 +1987,14 @@ class AdminController
$home_route = $config->get('system.home.alias');
$topParent = $obj->topParent();
if (isset($topParent)) {
if ($topParent->route() == $home_route) {
$route = (string)$topParent->route() . $route;
$top_parent_route = (string)$topParent->route();
if ($top_parent_route == $home_route && substr($route, 0, strlen($top_parent_route) + 1) != ($top_parent_route . '/')) {
$route = $top_parent_route . $route;
}
}
}
$redirect_url = '/' . ($multilang ? ($obj->language()) : '') . $admin_route . '/' . $this->view . $route;
$redirect_url = ($multilang ? '/' . $obj->language() : '') . $admin_route . '/' . $this->view . $route;
$this->setRedirect($redirect_url);
}