File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
app/code/Magento/Cms/Model/Wysiwyg/Images
lib/internal/Magento/Framework/Filesystem/Directory Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -543,7 +543,11 @@ public function deleteFile($target)
543
543
*/
544
544
public function uploadFile ($ targetPath , $ type = null )
545
545
{
546
- $ targetPath = $ this ->file ->getRealPathSafety ($ targetPath ) . DIRECTORY_SEPARATOR ;
546
+ $ targetPath = $ this ->file ->getRealPathSafety ($ targetPath );
547
+
548
+ if ($ this ->file ->isDirectory ($ targetPath )) {
549
+ $ targetPath = $ targetPath . DIRECTORY_SEPARATOR ;
550
+ }
547
551
548
552
if (!$ this ->isPathAllowed ($ targetPath , $ this ->getConditionsForExcludeDirs ()) || strlen ($ targetPath ) > 255 ) {
549
553
throw new \Magento \Framework \Exception \LocalizedException (
Original file line number Diff line number Diff line change @@ -209,14 +209,16 @@ public function isExist($path = null)
209
209
{
210
210
$ this ->validatePath ($ path );
211
211
212
- return $ this ->driver ->isExists ($ this ->driver ->getAbsolutePath ($ this ->path , $ path ));
212
+ return $ this ->driver ->isExists (
213
+ $ this ->driver ->getRealPathSafety ($ this ->driver ->getAbsolutePath ($ this ->path , $ path ))
214
+ );
213
215
}
214
216
215
217
/**
216
218
* Gathers the statistics of the given path
217
219
*
218
220
* @param string $path
219
- * @return array
221
+ * @return arrays
220
222
* @throws \Magento\Framework\Exception\FileSystemException
221
223
* @throws ValidatorException
222
224
*/
You can’t perform that action at this time.
0 commit comments