Added support for spaces in page and media urls

This commit is contained in:
Andy Miller
2014-10-05 18:43:33 -06:00
parent ce4a9a02d4
commit 9eb06da9a9
2 changed files with 4 additions and 3 deletions

View File

@@ -100,8 +100,9 @@ class Grav extends Container
$page = $c['pages']->dispatch($path_parts['dirname']);
if ($page) {
$media = $page->media()->all();
if (isset($media[$path_parts['basename']])) {
$medium = $media[$path_parts['basename']];
$media_file = urldecode($path_parts['basename']);
if (isset($media[$media_file])) {
$medium = $media[$media_file];
// loop through actions for the image and call them
foreach ($c['uri']->query(null,true) as $action => $params) {

View File

@@ -133,7 +133,7 @@ class Uri
*/
public function route($absolute = false, $domain = false)
{
return ($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths);
return urldecode(($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths));
}
/**