Skip to content

Commit 0d566f2

Browse files
authored
[4.x] Allow folders with image extensions in media manager (#42874)
1 parent dcd3772 commit 0d566f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/filesystem/local/src/Adapter/LocalAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private function getPathInformation(string $path): \stdClass
385385
$obj->path = str_replace($this->rootPath, '', $path);
386386
$obj->extension = !$isDir ? File::getExt($obj->name) : '';
387387
$obj->size = !$isDir ? filesize($path) : '';
388-
$obj->mime_type = MediaHelper::getMimeType($path, MediaHelper::isImage($obj->name));
388+
$obj->mime_type = !$isDir ? (string) MediaHelper::getMimeType($path, MediaHelper::isImage($obj->name)) : '';
389389
$obj->width = 0;
390390
$obj->height = 0;
391391

@@ -400,7 +400,7 @@ private function getPathInformation(string $path): \stdClass
400400
return $obj;
401401
}
402402

403-
if (MediaHelper::isImage($obj->name)) {
403+
if (!$isDir && MediaHelper::isImage($obj->name)) {
404404
// Get the image properties
405405
try {
406406
$props = Image::getImageFileProperties($path);

0 commit comments

Comments
 (0)