Remove reference to hardcoded media path

Replaces the reference to a hardcoded `/media` path when generating a local temp file path to utilize the folder name as set in `cms.storage.media.folder`.
This commit is contained in:
Luke Towers 2017-05-14 22:28:08 -06:00 committed by GitHub
parent 65c3e4388b
commit 7a820f3c43
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use Lang;
use File;
use Form;
use Input;
use Config;
use Request;
use Response;
use Exception;
@ -872,7 +873,7 @@ class MediaManager extends WidgetBase
{
$fileName = md5($fileName.uniqid().microtime());
$path = temp_path() . '/media';
$path = temp_path() . MediaLibrary::validatePath(Config::get('cms.storage.media.folder', 'media'), true);
if (!File::isDirectory($path)) {
File::makeDirectory($path, 0777, true, true);