mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-28 00:36:36 +01:00
Do not set an extension if the type is a directory
This commit is contained in:
@@ -1439,12 +1439,13 @@ class AdminController extends AdminBaseController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$type = $fileInfo->getType();
|
||||||
$payload = [
|
$payload = [
|
||||||
'filename' => $fileInfo->getFilename(),
|
'filename' => $fileInfo->getFilename(),
|
||||||
'path' => $fileInfo->getPath(),
|
'path' => $fileInfo->getPath(),
|
||||||
'basename' => $fileInfo->getBasename(),
|
'basename' => $fileInfo->getBasename(),
|
||||||
'extension' => $fileInfo->getExtension(),
|
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
|
||||||
'type' => $fileInfo->getType(),
|
'type' => $type,
|
||||||
'modified' => $fileInfo->getMTime(),
|
'modified' => $fileInfo->getMTime(),
|
||||||
'size' => $fileInfo->getSize()
|
'size' => $fileInfo->getSize()
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user