diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-02-12 11:12:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 11:12:38 +0100 |
commit | e053ce243e78c3d8ff713acfe027263f084b81fa (patch) | |
tree | 615beaefa662ee13efd890d73e713aab55ca2fd3 /core | |
parent | e7db4442c5af6f641c521291385eef07c6949cef (diff) | |
parent | 6fc5cef6e997d25583330a2f4bbc45ebc830a3e9 (diff) | |
download | nextcloud-server-e053ce243e78c3d8ff713acfe027263f084b81fa.tar.gz nextcloud-server-e053ce243e78c3d8ff713acfe027263f084b81fa.zip |
Merge pull request #43251 from nextcloud/fix/support-external-urls-in-navigation
Allow application to pass external links in navigation
Diffstat (limited to 'core')
-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 db1d67cc778..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'], $this->urlGenerator->getBaseUrl())) { + /* 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())) { |