fix(navigation): Fix absolute URLs from default apps

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2025-04-25 14:49:19 +02:00
parent 553870d30a
commit cdfce26ea9
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0

View file

@ -304,6 +304,11 @@ class URLGenerator implements IURLGenerator {
if ($href === '') {
throw new \InvalidArgumentException('Default navigation entry is missing href: ' . $entryId);
}
if (str_starts_with($href, $this->getBaseUrl())) {
return $href;
}
if (str_starts_with($href, '/index.php/') && ($this->config->getSystemValueBool('htaccess.IgnoreFrontController', false) || getenv('front_controller_active') === 'true')) {
$href = substr($href, 10);
}