Skip to content

Commit

Permalink
fix: Support other schemes than HTTP and HTTPS in app navigation
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Feb 1, 2024
1 parent ef59f72 commit 5088e58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/Controller/NavigationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ private function generateETag(array $navigation): string {
*/
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())) {
Expand Down

0 comments on commit 5088e58

Please sign in to comment.