From 09085c5e03014de729955381dbda0f4e377e667b Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 15 Feb 2017 05:51:30 +1100 Subject: [PATCH] Add explanation - Refs #2674 --- modules/cms/widgets/MediaManager.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/cms/widgets/MediaManager.php b/modules/cms/widgets/MediaManager.php index 8f103e29e..f7bdb1959 100644 --- a/modules/cms/widgets/MediaManager.php +++ b/modules/cms/widgets/MediaManager.php @@ -1098,11 +1098,14 @@ class MediaManager extends WidgetBase $path = $quickMode ? '/uploaded-files' : Input::get('path'); $path = MediaLibrary::validatePath($path); $filePath = $path.'/'.$fileName; - - $realPath = empty(trim($uploadedFile->getRealPath())) - ? $uploadedFile->getPath() . DIRECTORY_SEPARATOR . $uploadedFile->getFileName() + + /* + * getRealPath() can be empty for some environments (IIS) + */ + $realPath = empty(trim($uploadedFile->getRealPath())) + ? $uploadedFile->getPath() . DIRECTORY_SEPARATOR . $uploadedFile->getFileName() : $uploadedFile->getRealPath(); - + MediaLibrary::instance()->put( $filePath, File::get($realPath)