Skip to content

Commit

Permalink
Merge pull request #17 from aleeks/dev
Browse files Browse the repository at this point in the history
Fixed links for ps_imageslider
  • Loading branch information
Maxime Biloé authored May 9, 2017
2 parents ccdd6bc + 4565345 commit 2034cb0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ps_imageslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@ public function getWidgetVariables($hookName = null, array $configuration = [])
];
}

private function updateUrl($link)
{
if (substr($link, 0, 7) !== "http://" && substr($link, 0, 8) !== "https://") {
$link = "http://" . $link;
}

return $link;
}

public function clearCache()
{
$this->_clearCache($this->templateFile);
Expand Down Expand Up @@ -643,6 +652,7 @@ public function getSlides($active = null)

foreach ($slides as &$slide) {
$slide['image_url'] = $this->context->link->getMediaLink(_MODULE_DIR_.'ps_imageslider/images/'.$slide['image']);
$slide['url'] = $this->updateUrl($slide['url']);
}

return $slides;
Expand Down

0 comments on commit 2034cb0

Please sign in to comment.