diff --git a/CHANGELOG.md b/CHANGELOG.md index 16694a6..5740c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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"` diff --git a/SeomaticPlugin.php b/SeomaticPlugin.php index ced0411..26c6be5 100755 --- a/SeomaticPlugin.php +++ b/SeomaticPlugin.php @@ -26,7 +26,7 @@ public function getReleaseFeedUrl() public function getVersion() { - return '1.1.51'; + return '1.1.52'; } public function getSchemaVersion() diff --git a/releases.json b/releases.json index 75b1cfe..7619088 100644 --- a/releases.json +++ b/releases.json @@ -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", @@ -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", diff --git a/services/SeomaticService.php b/services/SeomaticService.php index 9802396..1ce58b4 100644 --- a/services/SeomaticService.php +++ b/services/SeomaticService.php @@ -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, '/'); diff --git a/templates/_seo_meta.twig b/templates/_seo_meta.twig index 38d4d03..ed33ac0 100755 --- a/templates/_seo_meta.twig +++ b/templates/_seo_meta.twig @@ -23,7 +23,7 @@ {% if localizedUrls |length > 0 %} {% else %} - + {% endif %} {% if localizedUrls |length > 1 %} {% for key, value in localizedUrls %} diff --git a/templates/_seo_metaPreview.twig b/templates/_seo_metaPreview.twig index a6811bd..9db6861 100755 --- a/templates/_seo_metaPreview.twig +++ b/templates/_seo_metaPreview.twig @@ -23,7 +23,7 @@ {% if localizedUrls |length > 0 %} {% else %} - + {% endif %} {% if localizedUrls |length > 1 %} {% for key, value in localizedUrls %}