Only force absolute URLs for media items if cms.linkPolicy = force

This fixes #4082 & rainlab/pages-plugin#405. Reverts a previous breaking change from Build 444 (introduced in #3536) by limiting the scope to which it applies.
This commit is contained in:
Luke Towers 2020-04-02 10:18:23 -06:00
parent 158fc43f62
commit ccb2c372bb
1 changed files with 6 additions and 2 deletions

View File

@ -537,9 +537,13 @@ class MediaLibrary
{ {
$path = $this->validatePath($path); $path = $this->validatePath($path);
$fullPath = $this->storagePath.implode("/", array_map("rawurlencode", explode("/", $path))); $fullPath = $this->storagePath . implode("/", array_map("rawurlencode", explode("/", $path)));
return Url::to($fullPath); if (Config::get('cms.linkPolicy') === 'force') {
return Url::to($fullPath);
} else {
return $fullPath;
}
} }
/** /**