fix portal

This commit is contained in:
yuri
2017-05-29 13:42:41 +03:00
parent 14ed7282f3
commit e6566bccdc
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -44,7 +44,9 @@ class Portal extends \Espo\Core\EntryPoints\Base
} else if (!empty($data['id'])) {
$id = $data['id'];
} else {
$id = explode('/', $_SERVER['REQUEST_URI'])[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
$url = !empty($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['REQUEST_URI'];
$id = explode('/', $url)[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
if (!$id) {
$id = $this->getConfig()->get('defaultPortalId');
}
+4 -2
View File
@@ -34,7 +34,9 @@ if (!$app->isInstalled()) {
exit;
}
$a = explode('?', $_SERVER['REQUEST_URI']);
$url = !empty($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['REQUEST_URI'];
$a = explode('?', $url);
if (substr($a[0], -1) !== '/') {
$url = $a[0] . '/';
if (count($a) > 1) {
@@ -44,7 +46,7 @@ if (substr($a[0], -1) !== '/') {
exit();
}
$portalId = explode('/', $_SERVER['REQUEST_URI'])[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
$portalId = explode('/', $url)[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
if ($portalId) {
$app->setBasePath('../../');
} else {