mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Allow application to pass external links in navigation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
5238b1c64c
commit
4fb5c15db5
1 changed files with 2 additions and 2 deletions
|
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue