Skip to content

Commit

Permalink
Merge branch 'release/1.1.52'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 2, 2017
2 parents 9fc72db + a0212f7 commit c6598ef
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# SEOmatic Changelog

## 1.1.52 - 2017.10.02
### Changed
* Fixed breadcrumbs (and other URLs) for certain multi-locale setups
* Fixed an issue with `hreflang='x-default'` with non-localized sites

## 1.1.51 - 2017.09.21
### Added
* Added support for `hreflang="x-default"`
Expand Down
2 changes: 1 addition & 1 deletion SeomaticPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getReleaseFeedUrl()

public function getVersion()
{
return '1.1.51';
return '1.1.52';
}

public function getSchemaVersion()
Expand Down
12 changes: 11 additions & 1 deletion releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "1.1.52",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
"date": "2017-10-02T11:00:00-11:00",
"notes": [
"[Fixed] Fixed breadcrumbs (and other URLs) for certain multi-locale setups",
"[Fixed] Fixed an issue with `hreflang='x-default'` with non-localized sites"
]
},
{
"version": "1.1.51",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
Expand Down Expand Up @@ -642,7 +651,8 @@
"[Improved] Converted all of the .html template files over to .twig",
"[Added] Expanded the JSON-LD parser to support ordinal arrays of associative arrays",
"[Fixed] Fixed an issue with the cannonical URL and some localized sites",
"[Improved] Updated the README.md" ]
"[Improved] Updated the README.md"
]
},
{
"version": "1.0.12",
Expand Down
25 changes: 16 additions & 9 deletions services/SeomaticService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3103,16 +3103,23 @@ public function getFullyQualifiedUrl($url)
if ($siteUrlOverride)
$siteUrl = $siteUrlOverride;
else
$siteUrl = craft()->getSiteUrl();

$urlParts = parse_url($siteUrl);
$port = "";
if (isset($urlParts['port']))
$port = ":" . $urlParts['port'];
if (isset($urlParts['scheme']) && isset($urlParts['host']))
$siteUrl = $urlParts['scheme'] . "://" . $urlParts['host'] . $port . "/";
$siteUrl = UrlHelper::getSiteUrl('', null, null, craft()->language);

if (UrlHelper::isAbsoluteUrl($siteUrl) || UrlHelper::isProtocolRelativeUrl($siteUrl))
{
/* -- The URL is already a fully qualfied URL, do nothing */
}
else
$siteUrl = "/";
{
$urlParts = parse_url($siteUrl);
$port = "";
if (isset($urlParts['port']))
$port = ":" . $urlParts['port'];
if (isset($urlParts['scheme']) && isset($urlParts['host']))
$siteUrl = $urlParts['scheme'] . "://" . $urlParts['host'] . $port . "/";
else
$siteUrl = "/";
}
if (($siteUrl[strlen($siteUrl) -1] == '/') && ($result[0] == '/'))
{
$siteUrl = rtrim($siteUrl, '/');
Expand Down
2 changes: 1 addition & 1 deletion templates/_seo_meta.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if localizedUrls |length > 0 %}
<link rel="alternate" href="{{ localizedUrls |first }}" hreflang="x-default" />
{% else %}
<link rel="alternate" href="{{ siteUrl }}" hreflang="x-default" />
<link rel="alternate" href="{{ seomaticMeta.canonicalUrl }}" hreflang="x-default" />
{% endif %}
{% if localizedUrls |length > 1 %}
{% for key, value in localizedUrls %}
Expand Down
2 changes: 1 addition & 1 deletion templates/_seo_metaPreview.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if localizedUrls |length > 0 %}
<link rel="alternate" href="{{ localizedUrls |first }}" hreflang="x-default" />
{% else %}
<link rel="alternate" href="{{ siteUrl }}" hreflang="x-default" />
<link rel="alternate" href="{{ seomaticMeta.canonicalUrl }}" hreflang="x-default" />
{% endif %}
{% if localizedUrls |length > 1 %}
{% for key, value in localizedUrls %}
Expand Down

0 comments on commit c6598ef

Please sign in to comment.