mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 23:34:22 -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
6c6af170c5
commit
eba0ff339b
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