Skip to content

Commit

Permalink
Fixed issue with URL not correctly set in link alternate tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogdani committed Aug 19, 2024
1 parent f948997 commit 93cb685
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/OutHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public function metadata($no_og = false)
array_push($part, '<meta name="viewport" content="width=device-width, initial-scale=1.0,shrink-to-fit=no">');
array_push($part, '<meta name="generator" content="BraDyCMS ' . $this->getVersion() . '">');

// http://stackoverflow.com/a/23717829/586449
$url = (utils::is_ssl() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = utils::getBaseUrl() . ltrim($_SERVER["REQUEST_URI"], '/');

// Current page in current language
array_push($part, '<link rel="alternate" href="' . $url . '" hreflang="' . $this->getLang('current', true) . '" />');
Expand Down
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
5.12.3[] = "Fixed issue with URL not correctly set in link alternate tag"
5.12.3[] = "Fixed issue with double slash when using utils::getBaseUrl"
5.12.2[] = "out::setPageData uses uses utils::getBaseUrl"
5.12.1[] = "Fixed bug with cfg.base_url UI"
Expand Down

0 comments on commit 93cb685

Please sign in to comment.