Skip to content

Commit

Permalink
Fix url encoding issue in url resolver.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksleight committed Nov 10, 2015
1 parent 6bca092 commit 8bf5356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/UrlResolver.php
Expand Up @@ -185,15 +185,15 @@ public function path($path, $base = true, $cdn = true, $cacheBust = true)
$path = $path->toReal();

$url = $path->toRelative($this->_baseDir);
$url = implode('/', array_map('rawurlencode', explode('/', $url)));
if ($base) {
if ($cdn && isset($this->_cdnUrl)) {
$url = $this->_cdnUrl . $url;
} else {
$url = $this->_baseUrl . $url;
}
}
$url = implode('/', array_map('rawurlencode', explode('/', $url)));
$url = (new \Coast\Url())->path($url);
$url = new \Coast\Url($url);

if ($cacheBust && isset($this->_cacheBust) && $path instanceof \Coast\File && $path->isReadable()) {
call_user_func($this->_cacheBust, $url, $path);
Expand Down

0 comments on commit 8bf5356

Please sign in to comment.