Skip to content

Commit

Permalink
Merge pull request #43520 from nextcloud/backport/43251/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin committed Feb 12, 2024
2 parents 6c6af17 + 4cf140b commit 5d409f7
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'], $this->urlGenerator->getBaseUrl())) {
/* 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 5d409f7

Please sign in to comment.