diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-01 09:52:37 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-02-12 10:14:20 +0000 |
commit | eba0ff339b340ba4623fa9c44117f729d8a6ffed (patch) | |
tree | 52ed642d232f867597ce9ca7ba0c12452c182ccd /core | |
parent | 6c6af170c535916c309ccb04579cc899205a58dd (diff) | |
download | nextcloud-server-eba0ff339b340ba4623fa9c44117f729d8a6ffed.tar.gz nextcloud-server-eba0ff339b340ba4623fa9c44117f729d8a6ffed.zip |
Allow application to pass external links in navigation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/NavigationController.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index db1d67cc778..61f8fe1d5e7 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -115,10 +115,10 @@ class NavigationController extends OCSController { */ private function rewriteToAbsoluteUrls(array $navigation): array { foreach ($navigation as &$entry) { - if (!str_starts_with($entry['href'], $this->urlGenerator->getBaseUrl())) { + if (!str_starts_with($entry['href'], 'https://') && !str_starts_with($entry['href'], 'http://')) { $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); } - if (!str_starts_with($entry['icon'], $this->urlGenerator->getBaseUrl())) { + if (!str_starts_with($entry['icon'], 'https://') && !str_starts_with($entry['icon'], 'http://')) { $entry['icon'] = $this->urlGenerator->getAbsoluteURL($entry['icon']); } } |