1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +02:00

When scanning for themes make sure to only consider visible folders

This commit is contained in:
Valentin
2021-03-24 11:00:28 +01:00
parent b706cc15da
commit 6fb8a5c83d

View File

@@ -33,7 +33,9 @@ class Settings
if(!isset($settings['theme']) OR !file_exists($themefolder . $settings['theme']))
{
# scan theme folder and get the first theme
$themes = array_diff(scandir($themefolder), array('..', '.'));
$themes = array_filter(scandir($themefolder), function ($item) use($themefolder) {
return is_dir($themefolder . $item) && strpos($item, '.') !== 0;
});
$firsttheme = reset($themes);
# if there is a theme with an index.twig-file