Skip to content

Commit b1155b3

Browse files
authored
Fix double slash on url
1 parent bca5632 commit b1155b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageStack/ImageBackend/HttpImageBackend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public function __construct($rootUrl, $options = array()) {
5151
protected function getImageUrl(ImagePathInterface $path) {
5252
$url = $path->getPath();
5353
if ($this->getOption('use_prefix', false)) {
54-
$url = rtrim($path->getPrefix(), '/') . '/' . $url;
54+
$url = rtrim($path->getPrefix(), '/') . '/' . ltrim($url, '/');
5555
}
5656
if ($this->getOption('root_url')) {
57-
$url = rtrim($this->getOption('root_url'), '/') . '/' . $url;
57+
$url = rtrim($this->getOption('root_url'), '/') . '/' . ltrim($url, '/');
5858
}
5959
return filter_var($url, FILTER_SANITIZE_URL);
6060
}

0 commit comments

Comments
 (0)