diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-01 14:29:51 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-02-06 09:36:39 +0100 |
commit | 6fc5cef6e997d25583330a2f4bbc45ebc830a3e9 (patch) | |
tree | 6e03ee08725c7dcd0e5bef226f1fb19d9c128fda /core/Controller/NavigationController.php | |
parent | 4f69f49a75afe349d1aa63a4a7b708f7bcb4e3a8 (diff) | |
download | nextcloud-server-6fc5cef6e997d25583330a2f4bbc45ebc830a3e9.tar.gz nextcloud-server-6fc5cef6e997d25583330a2f4bbc45ebc830a3e9.zip |
fix: Support other schemes than HTTP and HTTPS in app navigation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/Controller/NavigationController.php')
-rw-r--r-- | core/Controller/NavigationController.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index 2432df937ce..0996b41042e 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -115,7 +115,8 @@ class NavigationController extends OCSController { */ private function rewriteToAbsoluteUrls(array $navigation): array { foreach ($navigation as &$entry) { - if (!str_starts_with($entry['href'], 'https://') && !str_starts_with($entry['href'], 'http://')) { + /* If parse_url finds no host it means the URL is not absolute */ + if (!isset(\parse_url($entry['href'])['host'])) { $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); } if (!str_starts_with($entry['icon'], $this->urlGenerator->getBaseUrl())) { |