Make media URLs in accordance with the Link Policy (#3536)

Credit to @adsa95
This commit is contained in:
Adam Sandström 2018-12-01 22:08:04 +01:00 committed by Luke Towers
parent a1fb23a984
commit bd2f14d510
1 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use Cache;
use Config; use Config;
use Storage; use Storage;
use Request; use Request;
use Url;
use October\Rain\Filesystem\Definitions as FileDefinitions; use October\Rain\Filesystem\Definitions as FileDefinitions;
use ApplicationException; use ApplicationException;
use SystemException; use SystemException;
@ -538,7 +539,9 @@ class MediaLibrary
{ {
$path = $this->validatePath($path); $path = $this->validatePath($path);
return $this->storagePath.$path; $fullPath = $this->storagePath.implode("/", array_map("rawurlencode", explode("/", $path)));
return Url::to($fullPath);
} }
/** /**