mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: Support other schemes than HTTP and HTTPS in app navigation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
4f69f49a75
commit
6fc5cef6e9
1 changed files with 2 additions and 1 deletions
|
|
@ -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())) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue