diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-01 14:29:51 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-02-12 10:14:21 +0000 |
commit | 4cf140b5e5f20d384ff5ddea88eb030a791ca21c (patch) | |
tree | c9bfddbc8d11572c440b5f2294732f4d615130d9 /core/Controller | |
parent | ce808eefb5f5528542e2cc4c65ab1dcdabdf03b3 (diff) | |
download | nextcloud-server-4cf140b5e5f20d384ff5ddea88eb030a791ca21c.tar.gz nextcloud-server-4cf140b5e5f20d384ff5ddea88eb030a791ca21c.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')
-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())) { |