1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-15 09:34:14 +02:00

fix(admin-plugin): fix uploads directory in method getMediaList

This commit is contained in:
Awilum
2020-02-29 18:04:41 +03:00
parent 6f1702c932
commit 44884d6132

View File

@@ -1120,6 +1120,11 @@ class EntriesController extends Controller
{
$base_url = \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getBaseUrl();
$files = [];
if (!Filesystem::has(PATH['uploads'] . '/entries/' . $id)) {
Filesystem::createDir(PATH['uploads'] . '/entries/' . $id);
}
foreach (array_diff(scandir(PATH['uploads'] . '/entries/' . $id), ['..', '.']) as $file) {
if (strpos($this->registry->get('plugins.admin.entries.media.accept_file_types'), $file_ext = substr(strrchr($file, '.'), 1)) !== false) {
if (strpos($file, strtolower($file_ext), 1)) {