Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit c6598ef

Browse files
committed
Merge branch 'release/1.1.52'
2 parents 9fc72db + a0212f7 commit c6598ef

File tree

6 files changed

+35
-13
lines changed

6 files changed

+35
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# SEOmatic Changelog
22

3+
## 1.1.52 - 2017.10.02
4+
### Changed
5+
* Fixed breadcrumbs (and other URLs) for certain multi-locale setups
6+
* Fixed an issue with `hreflang='x-default'` with non-localized sites
7+
38
## 1.1.51 - 2017.09.21
49
### Added
510
* Added support for `hreflang="x-default"`

SeomaticPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getReleaseFeedUrl()
2626

2727
public function getVersion()
2828
{
29-
return '1.1.51';
29+
return '1.1.52';
3030
}
3131

3232
public function getSchemaVersion()

releases.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
[
2+
{
3+
"version": "1.1.52",
4+
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
5+
"date": "2017-10-02T11:00:00-11:00",
6+
"notes": [
7+
"[Fixed] Fixed breadcrumbs (and other URLs) for certain multi-locale setups",
8+
"[Fixed] Fixed an issue with `hreflang='x-default'` with non-localized sites"
9+
]
10+
},
211
{
312
"version": "1.1.51",
413
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
@@ -642,7 +651,8 @@
642651
"[Improved] Converted all of the .html template files over to .twig",
643652
"[Added] Expanded the JSON-LD parser to support ordinal arrays of associative arrays",
644653
"[Fixed] Fixed an issue with the cannonical URL and some localized sites",
645-
"[Improved] Updated the README.md" ]
654+
"[Improved] Updated the README.md"
655+
]
646656
},
647657
{
648658
"version": "1.0.12",

services/SeomaticService.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,16 +3103,23 @@ public function getFullyQualifiedUrl($url)
31033103
if ($siteUrlOverride)
31043104
$siteUrl = $siteUrlOverride;
31053105
else
3106-
$siteUrl = craft()->getSiteUrl();
3107-
3108-
$urlParts = parse_url($siteUrl);
3109-
$port = "";
3110-
if (isset($urlParts['port']))
3111-
$port = ":" . $urlParts['port'];
3112-
if (isset($urlParts['scheme']) && isset($urlParts['host']))
3113-
$siteUrl = $urlParts['scheme'] . "://" . $urlParts['host'] . $port . "/";
3106+
$siteUrl = UrlHelper::getSiteUrl('', null, null, craft()->language);
3107+
3108+
if (UrlHelper::isAbsoluteUrl($siteUrl) || UrlHelper::isProtocolRelativeUrl($siteUrl))
3109+
{
3110+
/* -- The URL is already a fully qualfied URL, do nothing */
3111+
}
31143112
else
3115-
$siteUrl = "/";
3113+
{
3114+
$urlParts = parse_url($siteUrl);
3115+
$port = "";
3116+
if (isset($urlParts['port']))
3117+
$port = ":" . $urlParts['port'];
3118+
if (isset($urlParts['scheme']) && isset($urlParts['host']))
3119+
$siteUrl = $urlParts['scheme'] . "://" . $urlParts['host'] . $port . "/";
3120+
else
3121+
$siteUrl = "/";
3122+
}
31163123
if (($siteUrl[strlen($siteUrl) -1] == '/') && ($result[0] == '/'))
31173124
{
31183125
$siteUrl = rtrim($siteUrl, '/');

templates/_seo_meta.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{% if localizedUrls |length > 0 %}
2424
<link rel="alternate" href="{{ localizedUrls |first }}" hreflang="x-default" />
2525
{% else %}
26-
<link rel="alternate" href="{{ siteUrl }}" hreflang="x-default" />
26+
<link rel="alternate" href="{{ seomaticMeta.canonicalUrl }}" hreflang="x-default" />
2727
{% endif %}
2828
{% if localizedUrls |length > 1 %}
2929
{% for key, value in localizedUrls %}

templates/_seo_metaPreview.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{% if localizedUrls |length > 0 %}
2424
<link rel="alternate" href="{{ localizedUrls |first }}" hreflang="x-default" />
2525
{% else %}
26-
<link rel="alternate" href="{{ siteUrl }}" hreflang="x-default" />
26+
<link rel="alternate" href="{{ seomaticMeta.canonicalUrl }}" hreflang="x-default" />
2727
{% endif %}
2828
{% if localizedUrls |length > 1 %}
2929
{% for key, value in localizedUrls %}

0 commit comments

Comments
 (0)