diff --git a/README.md b/README.md index a4eb5c0..838631c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [mediawesome](https://packagist.org/packages/nglasl/silverstripe-mediawesome) -_The current release is **4.0.4**_ +_The current release is **4.0.5**_ > This module allows creation of dynamic media holders/pages with CMS customisable types and attributes (blogs, events, news, publications), including versioning. diff --git a/src/pages/MediaPage.php b/src/pages/MediaPage.php index 8ae3645..cdc7b9c 100644 --- a/src/pages/MediaPage.php +++ b/src/pages/MediaPage.php @@ -4,6 +4,7 @@ use SilverStripe\Assets\File; use SilverStripe\Assets\Image; +use SilverStripe\Control\Controller; use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Core\Injector\Injector; use SilverStripe\Forms\DateField; @@ -408,10 +409,14 @@ public function Link($action = null) { return null; } $date = ($parent->URLFormatting !== '-') ? $this->dbObject('Date')->Format($parent->URLFormatting ?: 'y/MM/dd/') : ''; - $link = $parent->Link() . "{$date}{$this->URLSegment}/"; + $join = array( + $parent->Link(), + "{$date}{$this->URLSegment}/" + ); if($action) { - $link .= "{$action}/"; + $join[] = "{$action}/"; } + $link = Controller::join_links($join); return $link; }