Skip to content

Commit

Permalink
Merge branch 'release/1.1.54'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 10, 2017
2 parents 3d37a00 + 76a8888 commit b4a1d3c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# SEOmatic Changelog

## 1.1.54 - 2017.10.10
### Changed
* More intelligent handling of `addTrailingSlashesToUrls`

## 1.1.53 - 2017.10.06
### Changed
* Fixed a regression with certain types of localized sites
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.53';
return '1.1.54';
}

public function getSchemaVersion()
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "1.1.54",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
"date": "2017-10-10T11:00:00-11:00",
"notes": [
"[Improved] More intelligent handling of `addTrailingSlashesToUrls`"
]
},
{
"version": "1.1.53",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
Expand Down
16 changes: 9 additions & 7 deletions services/SeomaticService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3114,13 +3114,15 @@ public function getFullyQualifiedUrl($url)
$result = UrlHelper::getSiteUrl($url, null, null, craft()->language);
}
}
// Add a trailing / if `addTrailingSlashesToUrls` is set, but only if there's one extension
if (craft()->config->get('addTrailingSlashesToUrls')) {
$path = parse_url($result, PHP_URL_PATH);
$pathExtension = pathinfo($path,PATHINFO_EXTENSION);
if (empty($pathExtension))
$result = rtrim($result, '/') . '/';
}
}

$result = rtrim($result, '/');
// Add a trailing / if `addTrailingSlashesToUrls` is set, but only if there's one extension
if (craft()->config->get('addTrailingSlashesToUrls')) {
$path = parse_url($result, PHP_URL_PATH);
$pathExtension = pathinfo($path,PATHINFO_EXTENSION);
if (empty($pathExtension))
$result = rtrim($result, '/') . '/';
}

return $result;
Expand Down

0 comments on commit b4a1d3c

Please sign in to comment.