From 65247c4ce21f2cc53ecfe543be1cbb53d1f5608f Mon Sep 17 00:00:00 2001 From: tschallacka Date: Tue, 14 Feb 2017 09:22:34 +0100 Subject: [PATCH] Fix for get realPath on IIS. Sometimes getRealPath is empty when requested on IIS and needs to be rebuilt manually. --- modules/cms/widgets/MediaManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/cms/widgets/MediaManager.php b/modules/cms/widgets/MediaManager.php index e659ab700..8f103e29e 100644 --- a/modules/cms/widgets/MediaManager.php +++ b/modules/cms/widgets/MediaManager.php @@ -1098,10 +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() + : $uploadedFile->getRealPath(); + MediaLibrary::instance()->put( $filePath, - File::get($uploadedFile->getRealPath()) + File::get($realPath) ); /*